github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/actors/actorsfakes/fake_service_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package actorsfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/actors" 8 "code.cloudfoundry.org/cli/cf/models" 9 ) 10 11 type FakeServiceActor struct { 12 FilterBrokersStub func(string, string, string) ([]models.ServiceBroker, error) 13 filterBrokersMutex sync.RWMutex 14 filterBrokersArgsForCall []struct { 15 arg1 string 16 arg2 string 17 arg3 string 18 } 19 filterBrokersReturns struct { 20 result1 []models.ServiceBroker 21 result2 error 22 } 23 filterBrokersReturnsOnCall map[int]struct { 24 result1 []models.ServiceBroker 25 result2 error 26 } 27 invocations map[string][][]interface{} 28 invocationsMutex sync.RWMutex 29 } 30 31 func (fake *FakeServiceActor) FilterBrokers(arg1 string, arg2 string, arg3 string) ([]models.ServiceBroker, error) { 32 fake.filterBrokersMutex.Lock() 33 ret, specificReturn := fake.filterBrokersReturnsOnCall[len(fake.filterBrokersArgsForCall)] 34 fake.filterBrokersArgsForCall = append(fake.filterBrokersArgsForCall, struct { 35 arg1 string 36 arg2 string 37 arg3 string 38 }{arg1, arg2, arg3}) 39 fake.recordInvocation("FilterBrokers", []interface{}{arg1, arg2, arg3}) 40 fake.filterBrokersMutex.Unlock() 41 if fake.FilterBrokersStub != nil { 42 return fake.FilterBrokersStub(arg1, arg2, arg3) 43 } 44 if specificReturn { 45 return ret.result1, ret.result2 46 } 47 fakeReturns := fake.filterBrokersReturns 48 return fakeReturns.result1, fakeReturns.result2 49 } 50 51 func (fake *FakeServiceActor) FilterBrokersCallCount() int { 52 fake.filterBrokersMutex.RLock() 53 defer fake.filterBrokersMutex.RUnlock() 54 return len(fake.filterBrokersArgsForCall) 55 } 56 57 func (fake *FakeServiceActor) FilterBrokersCalls(stub func(string, string, string) ([]models.ServiceBroker, error)) { 58 fake.filterBrokersMutex.Lock() 59 defer fake.filterBrokersMutex.Unlock() 60 fake.FilterBrokersStub = stub 61 } 62 63 func (fake *FakeServiceActor) FilterBrokersArgsForCall(i int) (string, string, string) { 64 fake.filterBrokersMutex.RLock() 65 defer fake.filterBrokersMutex.RUnlock() 66 argsForCall := fake.filterBrokersArgsForCall[i] 67 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 68 } 69 70 func (fake *FakeServiceActor) FilterBrokersReturns(result1 []models.ServiceBroker, result2 error) { 71 fake.filterBrokersMutex.Lock() 72 defer fake.filterBrokersMutex.Unlock() 73 fake.FilterBrokersStub = nil 74 fake.filterBrokersReturns = struct { 75 result1 []models.ServiceBroker 76 result2 error 77 }{result1, result2} 78 } 79 80 func (fake *FakeServiceActor) FilterBrokersReturnsOnCall(i int, result1 []models.ServiceBroker, result2 error) { 81 fake.filterBrokersMutex.Lock() 82 defer fake.filterBrokersMutex.Unlock() 83 fake.FilterBrokersStub = nil 84 if fake.filterBrokersReturnsOnCall == nil { 85 fake.filterBrokersReturnsOnCall = make(map[int]struct { 86 result1 []models.ServiceBroker 87 result2 error 88 }) 89 } 90 fake.filterBrokersReturnsOnCall[i] = struct { 91 result1 []models.ServiceBroker 92 result2 error 93 }{result1, result2} 94 } 95 96 func (fake *FakeServiceActor) Invocations() map[string][][]interface{} { 97 fake.invocationsMutex.RLock() 98 defer fake.invocationsMutex.RUnlock() 99 fake.filterBrokersMutex.RLock() 100 defer fake.filterBrokersMutex.RUnlock() 101 copiedInvocations := map[string][][]interface{}{} 102 for key, value := range fake.invocations { 103 copiedInvocations[key] = value 104 } 105 return copiedInvocations 106 } 107 108 func (fake *FakeServiceActor) recordInvocation(key string, args []interface{}) { 109 fake.invocationsMutex.Lock() 110 defer fake.invocationsMutex.Unlock() 111 if fake.invocations == nil { 112 fake.invocations = map[string][][]interface{}{} 113 } 114 if fake.invocations[key] == nil { 115 fake.invocations[key] = [][]interface{}{} 116 } 117 fake.invocations[key] = append(fake.invocations[key], args) 118 } 119 120 var _ actors.ServiceActor = new(FakeServiceActor)