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

import (
	"sync"

	"code.cloudfoundry.org/cli/cf/actors"
	"code.cloudfoundry.org/cli/cf/models"
)

type FakeServiceActor struct {
	FilterBrokersStub        func(string, string, string) ([]models.ServiceBroker, error)
	filterBrokersMutex       sync.RWMutex
	filterBrokersArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 string
	}
	filterBrokersReturns struct {
		result1 []models.ServiceBroker
		result2 error
	}
	filterBrokersReturnsOnCall map[int]struct {
		result1 []models.ServiceBroker
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeServiceActor) FilterBrokers(arg1 string, arg2 string, arg3 string) ([]models.ServiceBroker, error) {
	fake.filterBrokersMutex.Lock()
	ret, specificReturn := fake.filterBrokersReturnsOnCall[len(fake.filterBrokersArgsForCall)]
	fake.filterBrokersArgsForCall = append(fake.filterBrokersArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	fake.recordInvocation("FilterBrokers", []interface{}{arg1, arg2, arg3})
	fake.filterBrokersMutex.Unlock()
	if fake.FilterBrokersStub != nil {
		return fake.FilterBrokersStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	fakeReturns := fake.filterBrokersReturns
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeServiceActor) FilterBrokersCallCount() int {
	fake.filterBrokersMutex.RLock()
	defer fake.filterBrokersMutex.RUnlock()
	return len(fake.filterBrokersArgsForCall)
}

func (fake *FakeServiceActor) FilterBrokersCalls(stub func(string, string, string) ([]models.ServiceBroker, error)) {
	fake.filterBrokersMutex.Lock()
	defer fake.filterBrokersMutex.Unlock()
	fake.FilterBrokersStub = stub
}

func (fake *FakeServiceActor) FilterBrokersArgsForCall(i int) (string, string, string) {
	fake.filterBrokersMutex.RLock()
	defer fake.filterBrokersMutex.RUnlock()
	argsForCall := fake.filterBrokersArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeServiceActor) FilterBrokersReturns(result1 []models.ServiceBroker, result2 error) {
	fake.filterBrokersMutex.Lock()
	defer fake.filterBrokersMutex.Unlock()
	fake.FilterBrokersStub = nil
	fake.filterBrokersReturns = struct {
		result1 []models.ServiceBroker
		result2 error
	}{result1, result2}
}

func (fake *FakeServiceActor) FilterBrokersReturnsOnCall(i int, result1 []models.ServiceBroker, result2 error) {
	fake.filterBrokersMutex.Lock()
	defer fake.filterBrokersMutex.Unlock()
	fake.FilterBrokersStub = nil
	if fake.filterBrokersReturnsOnCall == nil {
		fake.filterBrokersReturnsOnCall = make(map[int]struct {
			result1 []models.ServiceBroker
			result2 error
		})
	}
	fake.filterBrokersReturnsOnCall[i] = struct {
		result1 []models.ServiceBroker
		result2 error
	}{result1, result2}
}

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

func (fake *FakeServiceActor) 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 _ actors.ServiceActor = new(FakeServiceActor)
