github.com/orange-cloudfoundry/cli@v7.1.0+incompatible/command/v6/v6fakes/fake_update_service_actor.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package v6fakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/actor/v2action" 8 v6 "code.cloudfoundry.org/cli/command/v6" 9 ) 10 11 type FakeUpdateServiceActor struct { 12 CloudControllerAPIVersionStub func() string 13 cloudControllerAPIVersionMutex sync.RWMutex 14 cloudControllerAPIVersionArgsForCall []struct { 15 } 16 cloudControllerAPIVersionReturns struct { 17 result1 string 18 } 19 cloudControllerAPIVersionReturnsOnCall map[int]struct { 20 result1 string 21 } 22 GetServiceInstanceByNameAndSpaceStub func(string, string) (v2action.ServiceInstance, v2action.Warnings, error) 23 getServiceInstanceByNameAndSpaceMutex sync.RWMutex 24 getServiceInstanceByNameAndSpaceArgsForCall []struct { 25 arg1 string 26 arg2 string 27 } 28 getServiceInstanceByNameAndSpaceReturns struct { 29 result1 v2action.ServiceInstance 30 result2 v2action.Warnings 31 result3 error 32 } 33 getServiceInstanceByNameAndSpaceReturnsOnCall map[int]struct { 34 result1 v2action.ServiceInstance 35 result2 v2action.Warnings 36 result3 error 37 } 38 UpgradeServiceInstanceStub func(v2action.ServiceInstance) (v2action.Warnings, error) 39 upgradeServiceInstanceMutex sync.RWMutex 40 upgradeServiceInstanceArgsForCall []struct { 41 arg1 v2action.ServiceInstance 42 } 43 upgradeServiceInstanceReturns struct { 44 result1 v2action.Warnings 45 result2 error 46 } 47 upgradeServiceInstanceReturnsOnCall map[int]struct { 48 result1 v2action.Warnings 49 result2 error 50 } 51 invocations map[string][][]interface{} 52 invocationsMutex sync.RWMutex 53 } 54 55 func (fake *FakeUpdateServiceActor) CloudControllerAPIVersion() string { 56 fake.cloudControllerAPIVersionMutex.Lock() 57 ret, specificReturn := fake.cloudControllerAPIVersionReturnsOnCall[len(fake.cloudControllerAPIVersionArgsForCall)] 58 fake.cloudControllerAPIVersionArgsForCall = append(fake.cloudControllerAPIVersionArgsForCall, struct { 59 }{}) 60 fake.recordInvocation("CloudControllerAPIVersion", []interface{}{}) 61 fake.cloudControllerAPIVersionMutex.Unlock() 62 if fake.CloudControllerAPIVersionStub != nil { 63 return fake.CloudControllerAPIVersionStub() 64 } 65 if specificReturn { 66 return ret.result1 67 } 68 fakeReturns := fake.cloudControllerAPIVersionReturns 69 return fakeReturns.result1 70 } 71 72 func (fake *FakeUpdateServiceActor) CloudControllerAPIVersionCallCount() int { 73 fake.cloudControllerAPIVersionMutex.RLock() 74 defer fake.cloudControllerAPIVersionMutex.RUnlock() 75 return len(fake.cloudControllerAPIVersionArgsForCall) 76 } 77 78 func (fake *FakeUpdateServiceActor) CloudControllerAPIVersionCalls(stub func() string) { 79 fake.cloudControllerAPIVersionMutex.Lock() 80 defer fake.cloudControllerAPIVersionMutex.Unlock() 81 fake.CloudControllerAPIVersionStub = stub 82 } 83 84 func (fake *FakeUpdateServiceActor) CloudControllerAPIVersionReturns(result1 string) { 85 fake.cloudControllerAPIVersionMutex.Lock() 86 defer fake.cloudControllerAPIVersionMutex.Unlock() 87 fake.CloudControllerAPIVersionStub = nil 88 fake.cloudControllerAPIVersionReturns = struct { 89 result1 string 90 }{result1} 91 } 92 93 func (fake *FakeUpdateServiceActor) CloudControllerAPIVersionReturnsOnCall(i int, result1 string) { 94 fake.cloudControllerAPIVersionMutex.Lock() 95 defer fake.cloudControllerAPIVersionMutex.Unlock() 96 fake.CloudControllerAPIVersionStub = nil 97 if fake.cloudControllerAPIVersionReturnsOnCall == nil { 98 fake.cloudControllerAPIVersionReturnsOnCall = make(map[int]struct { 99 result1 string 100 }) 101 } 102 fake.cloudControllerAPIVersionReturnsOnCall[i] = struct { 103 result1 string 104 }{result1} 105 } 106 107 func (fake *FakeUpdateServiceActor) GetServiceInstanceByNameAndSpace(arg1 string, arg2 string) (v2action.ServiceInstance, v2action.Warnings, error) { 108 fake.getServiceInstanceByNameAndSpaceMutex.Lock() 109 ret, specificReturn := fake.getServiceInstanceByNameAndSpaceReturnsOnCall[len(fake.getServiceInstanceByNameAndSpaceArgsForCall)] 110 fake.getServiceInstanceByNameAndSpaceArgsForCall = append(fake.getServiceInstanceByNameAndSpaceArgsForCall, struct { 111 arg1 string 112 arg2 string 113 }{arg1, arg2}) 114 fake.recordInvocation("GetServiceInstanceByNameAndSpace", []interface{}{arg1, arg2}) 115 fake.getServiceInstanceByNameAndSpaceMutex.Unlock() 116 if fake.GetServiceInstanceByNameAndSpaceStub != nil { 117 return fake.GetServiceInstanceByNameAndSpaceStub(arg1, arg2) 118 } 119 if specificReturn { 120 return ret.result1, ret.result2, ret.result3 121 } 122 fakeReturns := fake.getServiceInstanceByNameAndSpaceReturns 123 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 124 } 125 126 func (fake *FakeUpdateServiceActor) GetServiceInstanceByNameAndSpaceCallCount() int { 127 fake.getServiceInstanceByNameAndSpaceMutex.RLock() 128 defer fake.getServiceInstanceByNameAndSpaceMutex.RUnlock() 129 return len(fake.getServiceInstanceByNameAndSpaceArgsForCall) 130 } 131 132 func (fake *FakeUpdateServiceActor) GetServiceInstanceByNameAndSpaceCalls(stub func(string, string) (v2action.ServiceInstance, v2action.Warnings, error)) { 133 fake.getServiceInstanceByNameAndSpaceMutex.Lock() 134 defer fake.getServiceInstanceByNameAndSpaceMutex.Unlock() 135 fake.GetServiceInstanceByNameAndSpaceStub = stub 136 } 137 138 func (fake *FakeUpdateServiceActor) GetServiceInstanceByNameAndSpaceArgsForCall(i int) (string, string) { 139 fake.getServiceInstanceByNameAndSpaceMutex.RLock() 140 defer fake.getServiceInstanceByNameAndSpaceMutex.RUnlock() 141 argsForCall := fake.getServiceInstanceByNameAndSpaceArgsForCall[i] 142 return argsForCall.arg1, argsForCall.arg2 143 } 144 145 func (fake *FakeUpdateServiceActor) GetServiceInstanceByNameAndSpaceReturns(result1 v2action.ServiceInstance, result2 v2action.Warnings, result3 error) { 146 fake.getServiceInstanceByNameAndSpaceMutex.Lock() 147 defer fake.getServiceInstanceByNameAndSpaceMutex.Unlock() 148 fake.GetServiceInstanceByNameAndSpaceStub = nil 149 fake.getServiceInstanceByNameAndSpaceReturns = struct { 150 result1 v2action.ServiceInstance 151 result2 v2action.Warnings 152 result3 error 153 }{result1, result2, result3} 154 } 155 156 func (fake *FakeUpdateServiceActor) GetServiceInstanceByNameAndSpaceReturnsOnCall(i int, result1 v2action.ServiceInstance, result2 v2action.Warnings, result3 error) { 157 fake.getServiceInstanceByNameAndSpaceMutex.Lock() 158 defer fake.getServiceInstanceByNameAndSpaceMutex.Unlock() 159 fake.GetServiceInstanceByNameAndSpaceStub = nil 160 if fake.getServiceInstanceByNameAndSpaceReturnsOnCall == nil { 161 fake.getServiceInstanceByNameAndSpaceReturnsOnCall = make(map[int]struct { 162 result1 v2action.ServiceInstance 163 result2 v2action.Warnings 164 result3 error 165 }) 166 } 167 fake.getServiceInstanceByNameAndSpaceReturnsOnCall[i] = struct { 168 result1 v2action.ServiceInstance 169 result2 v2action.Warnings 170 result3 error 171 }{result1, result2, result3} 172 } 173 174 func (fake *FakeUpdateServiceActor) UpgradeServiceInstance(arg1 v2action.ServiceInstance) (v2action.Warnings, error) { 175 fake.upgradeServiceInstanceMutex.Lock() 176 ret, specificReturn := fake.upgradeServiceInstanceReturnsOnCall[len(fake.upgradeServiceInstanceArgsForCall)] 177 fake.upgradeServiceInstanceArgsForCall = append(fake.upgradeServiceInstanceArgsForCall, struct { 178 arg1 v2action.ServiceInstance 179 }{arg1}) 180 fake.recordInvocation("UpgradeServiceInstance", []interface{}{arg1}) 181 fake.upgradeServiceInstanceMutex.Unlock() 182 if fake.UpgradeServiceInstanceStub != nil { 183 return fake.UpgradeServiceInstanceStub(arg1) 184 } 185 if specificReturn { 186 return ret.result1, ret.result2 187 } 188 fakeReturns := fake.upgradeServiceInstanceReturns 189 return fakeReturns.result1, fakeReturns.result2 190 } 191 192 func (fake *FakeUpdateServiceActor) UpgradeServiceInstanceCallCount() int { 193 fake.upgradeServiceInstanceMutex.RLock() 194 defer fake.upgradeServiceInstanceMutex.RUnlock() 195 return len(fake.upgradeServiceInstanceArgsForCall) 196 } 197 198 func (fake *FakeUpdateServiceActor) UpgradeServiceInstanceCalls(stub func(v2action.ServiceInstance) (v2action.Warnings, error)) { 199 fake.upgradeServiceInstanceMutex.Lock() 200 defer fake.upgradeServiceInstanceMutex.Unlock() 201 fake.UpgradeServiceInstanceStub = stub 202 } 203 204 func (fake *FakeUpdateServiceActor) UpgradeServiceInstanceArgsForCall(i int) v2action.ServiceInstance { 205 fake.upgradeServiceInstanceMutex.RLock() 206 defer fake.upgradeServiceInstanceMutex.RUnlock() 207 argsForCall := fake.upgradeServiceInstanceArgsForCall[i] 208 return argsForCall.arg1 209 } 210 211 func (fake *FakeUpdateServiceActor) UpgradeServiceInstanceReturns(result1 v2action.Warnings, result2 error) { 212 fake.upgradeServiceInstanceMutex.Lock() 213 defer fake.upgradeServiceInstanceMutex.Unlock() 214 fake.UpgradeServiceInstanceStub = nil 215 fake.upgradeServiceInstanceReturns = struct { 216 result1 v2action.Warnings 217 result2 error 218 }{result1, result2} 219 } 220 221 func (fake *FakeUpdateServiceActor) UpgradeServiceInstanceReturnsOnCall(i int, result1 v2action.Warnings, result2 error) { 222 fake.upgradeServiceInstanceMutex.Lock() 223 defer fake.upgradeServiceInstanceMutex.Unlock() 224 fake.UpgradeServiceInstanceStub = nil 225 if fake.upgradeServiceInstanceReturnsOnCall == nil { 226 fake.upgradeServiceInstanceReturnsOnCall = make(map[int]struct { 227 result1 v2action.Warnings 228 result2 error 229 }) 230 } 231 fake.upgradeServiceInstanceReturnsOnCall[i] = struct { 232 result1 v2action.Warnings 233 result2 error 234 }{result1, result2} 235 } 236 237 func (fake *FakeUpdateServiceActor) Invocations() map[string][][]interface{} { 238 fake.invocationsMutex.RLock() 239 defer fake.invocationsMutex.RUnlock() 240 fake.cloudControllerAPIVersionMutex.RLock() 241 defer fake.cloudControllerAPIVersionMutex.RUnlock() 242 fake.getServiceInstanceByNameAndSpaceMutex.RLock() 243 defer fake.getServiceInstanceByNameAndSpaceMutex.RUnlock() 244 fake.upgradeServiceInstanceMutex.RLock() 245 defer fake.upgradeServiceInstanceMutex.RUnlock() 246 copiedInvocations := map[string][][]interface{}{} 247 for key, value := range fake.invocations { 248 copiedInvocations[key] = value 249 } 250 return copiedInvocations 251 } 252 253 func (fake *FakeUpdateServiceActor) recordInvocation(key string, args []interface{}) { 254 fake.invocationsMutex.Lock() 255 defer fake.invocationsMutex.Unlock() 256 if fake.invocations == nil { 257 fake.invocations = map[string][][]interface{}{} 258 } 259 if fake.invocations[key] == nil { 260 fake.invocations[key] = [][]interface{}{} 261 } 262 fake.invocations[key] = append(fake.invocations[key], args) 263 } 264 265 var _ v6.UpdateServiceActor = new(FakeUpdateServiceActor)