github.com/loggregator/cli@v6.33.1-0.20180224010324-82334f081791+incompatible/cf/requirements/requirementsfakes/fake_service_instance_requirement.go (about) 1 // This file was generated by counterfeiter 2 package requirementsfakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/models" 8 "code.cloudfoundry.org/cli/cf/requirements" 9 ) 10 11 type FakeServiceInstanceRequirement struct { 12 ExecuteStub func() error 13 executeMutex sync.RWMutex 14 executeArgsForCall []struct{} 15 executeReturns struct { 16 result1 error 17 } 18 GetServiceInstanceStub func() models.ServiceInstance 19 getServiceInstanceMutex sync.RWMutex 20 getServiceInstanceArgsForCall []struct{} 21 getServiceInstanceReturns struct { 22 result1 models.ServiceInstance 23 } 24 invocations map[string][][]interface{} 25 invocationsMutex sync.RWMutex 26 } 27 28 func (fake *FakeServiceInstanceRequirement) Execute() error { 29 fake.executeMutex.Lock() 30 fake.executeArgsForCall = append(fake.executeArgsForCall, struct{}{}) 31 fake.recordInvocation("Execute", []interface{}{}) 32 fake.executeMutex.Unlock() 33 if fake.ExecuteStub != nil { 34 return fake.ExecuteStub() 35 } else { 36 return fake.executeReturns.result1 37 } 38 } 39 40 func (fake *FakeServiceInstanceRequirement) ExecuteCallCount() int { 41 fake.executeMutex.RLock() 42 defer fake.executeMutex.RUnlock() 43 return len(fake.executeArgsForCall) 44 } 45 46 func (fake *FakeServiceInstanceRequirement) ExecuteReturns(result1 error) { 47 fake.ExecuteStub = nil 48 fake.executeReturns = struct { 49 result1 error 50 }{result1} 51 } 52 53 func (fake *FakeServiceInstanceRequirement) GetServiceInstance() models.ServiceInstance { 54 fake.getServiceInstanceMutex.Lock() 55 fake.getServiceInstanceArgsForCall = append(fake.getServiceInstanceArgsForCall, struct{}{}) 56 fake.recordInvocation("GetServiceInstance", []interface{}{}) 57 fake.getServiceInstanceMutex.Unlock() 58 if fake.GetServiceInstanceStub != nil { 59 return fake.GetServiceInstanceStub() 60 } else { 61 return fake.getServiceInstanceReturns.result1 62 } 63 } 64 65 func (fake *FakeServiceInstanceRequirement) GetServiceInstanceCallCount() int { 66 fake.getServiceInstanceMutex.RLock() 67 defer fake.getServiceInstanceMutex.RUnlock() 68 return len(fake.getServiceInstanceArgsForCall) 69 } 70 71 func (fake *FakeServiceInstanceRequirement) GetServiceInstanceReturns(result1 models.ServiceInstance) { 72 fake.GetServiceInstanceStub = nil 73 fake.getServiceInstanceReturns = struct { 74 result1 models.ServiceInstance 75 }{result1} 76 } 77 78 func (fake *FakeServiceInstanceRequirement) Invocations() map[string][][]interface{} { 79 fake.invocationsMutex.RLock() 80 defer fake.invocationsMutex.RUnlock() 81 fake.executeMutex.RLock() 82 defer fake.executeMutex.RUnlock() 83 fake.getServiceInstanceMutex.RLock() 84 defer fake.getServiceInstanceMutex.RUnlock() 85 return fake.invocations 86 } 87 88 func (fake *FakeServiceInstanceRequirement) recordInvocation(key string, args []interface{}) { 89 fake.invocationsMutex.Lock() 90 defer fake.invocationsMutex.Unlock() 91 if fake.invocations == nil { 92 fake.invocations = map[string][][]interface{}{} 93 } 94 if fake.invocations[key] == nil { 95 fake.invocations[key] = [][]interface{}{} 96 } 97 fake.invocations[key] = append(fake.invocations[key], args) 98 } 99 100 var _ requirements.ServiceInstanceRequirement = new(FakeServiceInstanceRequirement)