// Code generated by counterfeiter. DO NOT EDIT.
package fakes

import (
	"sync"

	"github.com/operator-framework/api/pkg/operators/v1alpha1"
	"github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/resolver"
)

type FakeResolver struct {
	ResolveStepsStub        func(string, resolver.SourceQuerier) ([]*v1alpha1.Step, []v1alpha1.BundleLookup, []*v1alpha1.Subscription, error)
	resolveStepsMutex       sync.RWMutex
	resolveStepsArgsForCall []struct {
		arg1 string
		arg2 resolver.SourceQuerier
	}
	resolveStepsReturns struct {
		result1 []*v1alpha1.Step
		result2 []v1alpha1.BundleLookup
		result3 []*v1alpha1.Subscription
		result4 error
	}
	resolveStepsReturnsOnCall map[int]struct {
		result1 []*v1alpha1.Step
		result2 []v1alpha1.BundleLookup
		result3 []*v1alpha1.Subscription
		result4 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeResolver) ResolveSteps(arg1 string, arg2 resolver.SourceQuerier) ([]*v1alpha1.Step, []v1alpha1.BundleLookup, []*v1alpha1.Subscription, error) {
	fake.resolveStepsMutex.Lock()
	ret, specificReturn := fake.resolveStepsReturnsOnCall[len(fake.resolveStepsArgsForCall)]
	fake.resolveStepsArgsForCall = append(fake.resolveStepsArgsForCall, struct {
		arg1 string
		arg2 resolver.SourceQuerier
	}{arg1, arg2})
	fake.recordInvocation("ResolveSteps", []interface{}{arg1, arg2})
	fake.resolveStepsMutex.Unlock()
	if fake.ResolveStepsStub != nil {
		return fake.ResolveStepsStub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2, ret.result3, ret.result4
	}
	fakeReturns := fake.resolveStepsReturns
	return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3, fakeReturns.result4
}

func (fake *FakeResolver) ResolveStepsCallCount() int {
	fake.resolveStepsMutex.RLock()
	defer fake.resolveStepsMutex.RUnlock()
	return len(fake.resolveStepsArgsForCall)
}

func (fake *FakeResolver) ResolveStepsCalls(stub func(string, resolver.SourceQuerier) ([]*v1alpha1.Step, []v1alpha1.BundleLookup, []*v1alpha1.Subscription, error)) {
	fake.resolveStepsMutex.Lock()
	defer fake.resolveStepsMutex.Unlock()
	fake.ResolveStepsStub = stub
}

func (fake *FakeResolver) ResolveStepsArgsForCall(i int) (string, resolver.SourceQuerier) {
	fake.resolveStepsMutex.RLock()
	defer fake.resolveStepsMutex.RUnlock()
	argsForCall := fake.resolveStepsArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeResolver) ResolveStepsReturns(result1 []*v1alpha1.Step, result2 []v1alpha1.BundleLookup, result3 []*v1alpha1.Subscription, result4 error) {
	fake.resolveStepsMutex.Lock()
	defer fake.resolveStepsMutex.Unlock()
	fake.ResolveStepsStub = nil
	fake.resolveStepsReturns = struct {
		result1 []*v1alpha1.Step
		result2 []v1alpha1.BundleLookup
		result3 []*v1alpha1.Subscription
		result4 error
	}{result1, result2, result3, result4}
}

func (fake *FakeResolver) ResolveStepsReturnsOnCall(i int, result1 []*v1alpha1.Step, result2 []v1alpha1.BundleLookup, result3 []*v1alpha1.Subscription, result4 error) {
	fake.resolveStepsMutex.Lock()
	defer fake.resolveStepsMutex.Unlock()
	fake.ResolveStepsStub = nil
	if fake.resolveStepsReturnsOnCall == nil {
		fake.resolveStepsReturnsOnCall = make(map[int]struct {
			result1 []*v1alpha1.Step
			result2 []v1alpha1.BundleLookup
			result3 []*v1alpha1.Subscription
			result4 error
		})
	}
	fake.resolveStepsReturnsOnCall[i] = struct {
		result1 []*v1alpha1.Step
		result2 []v1alpha1.BundleLookup
		result3 []*v1alpha1.Subscription
		result4 error
	}{result1, result2, result3, result4}
}

func (fake *FakeResolver) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.resolveStepsMutex.RLock()
	defer fake.resolveStepsMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeResolver) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ resolver.Resolver = new(FakeResolver)
