github.com/sleungcy-sap/cli@v7.1.0+incompatible/cf/requirements/requirementsfakes/fake_service_instance_requirement.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 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 } 16 executeReturns struct { 17 result1 error 18 } 19 executeReturnsOnCall map[int]struct { 20 result1 error 21 } 22 GetServiceInstanceStub func() models.ServiceInstance 23 getServiceInstanceMutex sync.RWMutex 24 getServiceInstanceArgsForCall []struct { 25 } 26 getServiceInstanceReturns struct { 27 result1 models.ServiceInstance 28 } 29 getServiceInstanceReturnsOnCall map[int]struct { 30 result1 models.ServiceInstance 31 } 32 invocations map[string][][]interface{} 33 invocationsMutex sync.RWMutex 34 } 35 36 func (fake *FakeServiceInstanceRequirement) Execute() error { 37 fake.executeMutex.Lock() 38 ret, specificReturn := fake.executeReturnsOnCall[len(fake.executeArgsForCall)] 39 fake.executeArgsForCall = append(fake.executeArgsForCall, struct { 40 }{}) 41 fake.recordInvocation("Execute", []interface{}{}) 42 fake.executeMutex.Unlock() 43 if fake.ExecuteStub != nil { 44 return fake.ExecuteStub() 45 } 46 if specificReturn { 47 return ret.result1 48 } 49 fakeReturns := fake.executeReturns 50 return fakeReturns.result1 51 } 52 53 func (fake *FakeServiceInstanceRequirement) ExecuteCallCount() int { 54 fake.executeMutex.RLock() 55 defer fake.executeMutex.RUnlock() 56 return len(fake.executeArgsForCall) 57 } 58 59 func (fake *FakeServiceInstanceRequirement) ExecuteCalls(stub func() error) { 60 fake.executeMutex.Lock() 61 defer fake.executeMutex.Unlock() 62 fake.ExecuteStub = stub 63 } 64 65 func (fake *FakeServiceInstanceRequirement) ExecuteReturns(result1 error) { 66 fake.executeMutex.Lock() 67 defer fake.executeMutex.Unlock() 68 fake.ExecuteStub = nil 69 fake.executeReturns = struct { 70 result1 error 71 }{result1} 72 } 73 74 func (fake *FakeServiceInstanceRequirement) ExecuteReturnsOnCall(i int, result1 error) { 75 fake.executeMutex.Lock() 76 defer fake.executeMutex.Unlock() 77 fake.ExecuteStub = nil 78 if fake.executeReturnsOnCall == nil { 79 fake.executeReturnsOnCall = make(map[int]struct { 80 result1 error 81 }) 82 } 83 fake.executeReturnsOnCall[i] = struct { 84 result1 error 85 }{result1} 86 } 87 88 func (fake *FakeServiceInstanceRequirement) GetServiceInstance() models.ServiceInstance { 89 fake.getServiceInstanceMutex.Lock() 90 ret, specificReturn := fake.getServiceInstanceReturnsOnCall[len(fake.getServiceInstanceArgsForCall)] 91 fake.getServiceInstanceArgsForCall = append(fake.getServiceInstanceArgsForCall, struct { 92 }{}) 93 fake.recordInvocation("GetServiceInstance", []interface{}{}) 94 fake.getServiceInstanceMutex.Unlock() 95 if fake.GetServiceInstanceStub != nil { 96 return fake.GetServiceInstanceStub() 97 } 98 if specificReturn { 99 return ret.result1 100 } 101 fakeReturns := fake.getServiceInstanceReturns 102 return fakeReturns.result1 103 } 104 105 func (fake *FakeServiceInstanceRequirement) GetServiceInstanceCallCount() int { 106 fake.getServiceInstanceMutex.RLock() 107 defer fake.getServiceInstanceMutex.RUnlock() 108 return len(fake.getServiceInstanceArgsForCall) 109 } 110 111 func (fake *FakeServiceInstanceRequirement) GetServiceInstanceCalls(stub func() models.ServiceInstance) { 112 fake.getServiceInstanceMutex.Lock() 113 defer fake.getServiceInstanceMutex.Unlock() 114 fake.GetServiceInstanceStub = stub 115 } 116 117 func (fake *FakeServiceInstanceRequirement) GetServiceInstanceReturns(result1 models.ServiceInstance) { 118 fake.getServiceInstanceMutex.Lock() 119 defer fake.getServiceInstanceMutex.Unlock() 120 fake.GetServiceInstanceStub = nil 121 fake.getServiceInstanceReturns = struct { 122 result1 models.ServiceInstance 123 }{result1} 124 } 125 126 func (fake *FakeServiceInstanceRequirement) GetServiceInstanceReturnsOnCall(i int, result1 models.ServiceInstance) { 127 fake.getServiceInstanceMutex.Lock() 128 defer fake.getServiceInstanceMutex.Unlock() 129 fake.GetServiceInstanceStub = nil 130 if fake.getServiceInstanceReturnsOnCall == nil { 131 fake.getServiceInstanceReturnsOnCall = make(map[int]struct { 132 result1 models.ServiceInstance 133 }) 134 } 135 fake.getServiceInstanceReturnsOnCall[i] = struct { 136 result1 models.ServiceInstance 137 }{result1} 138 } 139 140 func (fake *FakeServiceInstanceRequirement) Invocations() map[string][][]interface{} { 141 fake.invocationsMutex.RLock() 142 defer fake.invocationsMutex.RUnlock() 143 fake.executeMutex.RLock() 144 defer fake.executeMutex.RUnlock() 145 fake.getServiceInstanceMutex.RLock() 146 defer fake.getServiceInstanceMutex.RUnlock() 147 copiedInvocations := map[string][][]interface{}{} 148 for key, value := range fake.invocations { 149 copiedInvocations[key] = value 150 } 151 return copiedInvocations 152 } 153 154 func (fake *FakeServiceInstanceRequirement) recordInvocation(key string, args []interface{}) { 155 fake.invocationsMutex.Lock() 156 defer fake.invocationsMutex.Unlock() 157 if fake.invocations == nil { 158 fake.invocations = map[string][][]interface{}{} 159 } 160 if fake.invocations[key] == nil { 161 fake.invocations[key] = [][]interface{}{} 162 } 163 fake.invocations[key] = append(fake.invocations[key], args) 164 } 165 166 var _ requirements.ServiceInstanceRequirement = new(FakeServiceInstanceRequirement)