github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_service_auth_token_repository.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package apifakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/cli/cf/api" 8 "code.cloudfoundry.org/cli/cf/models" 9 ) 10 11 type FakeServiceAuthTokenRepository struct { 12 CreateStub func(models.ServiceAuthTokenFields) error 13 createMutex sync.RWMutex 14 createArgsForCall []struct { 15 arg1 models.ServiceAuthTokenFields 16 } 17 createReturns struct { 18 result1 error 19 } 20 createReturnsOnCall map[int]struct { 21 result1 error 22 } 23 DeleteStub func(models.ServiceAuthTokenFields) error 24 deleteMutex sync.RWMutex 25 deleteArgsForCall []struct { 26 arg1 models.ServiceAuthTokenFields 27 } 28 deleteReturns struct { 29 result1 error 30 } 31 deleteReturnsOnCall map[int]struct { 32 result1 error 33 } 34 FindAllStub func() ([]models.ServiceAuthTokenFields, error) 35 findAllMutex sync.RWMutex 36 findAllArgsForCall []struct { 37 } 38 findAllReturns struct { 39 result1 []models.ServiceAuthTokenFields 40 result2 error 41 } 42 findAllReturnsOnCall map[int]struct { 43 result1 []models.ServiceAuthTokenFields 44 result2 error 45 } 46 FindByLabelAndProviderStub func(string, string) (models.ServiceAuthTokenFields, error) 47 findByLabelAndProviderMutex sync.RWMutex 48 findByLabelAndProviderArgsForCall []struct { 49 arg1 string 50 arg2 string 51 } 52 findByLabelAndProviderReturns struct { 53 result1 models.ServiceAuthTokenFields 54 result2 error 55 } 56 findByLabelAndProviderReturnsOnCall map[int]struct { 57 result1 models.ServiceAuthTokenFields 58 result2 error 59 } 60 UpdateStub func(models.ServiceAuthTokenFields) error 61 updateMutex sync.RWMutex 62 updateArgsForCall []struct { 63 arg1 models.ServiceAuthTokenFields 64 } 65 updateReturns struct { 66 result1 error 67 } 68 updateReturnsOnCall map[int]struct { 69 result1 error 70 } 71 invocations map[string][][]interface{} 72 invocationsMutex sync.RWMutex 73 } 74 75 func (fake *FakeServiceAuthTokenRepository) Create(arg1 models.ServiceAuthTokenFields) error { 76 fake.createMutex.Lock() 77 ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)] 78 fake.createArgsForCall = append(fake.createArgsForCall, struct { 79 arg1 models.ServiceAuthTokenFields 80 }{arg1}) 81 fake.recordInvocation("Create", []interface{}{arg1}) 82 fake.createMutex.Unlock() 83 if fake.CreateStub != nil { 84 return fake.CreateStub(arg1) 85 } 86 if specificReturn { 87 return ret.result1 88 } 89 fakeReturns := fake.createReturns 90 return fakeReturns.result1 91 } 92 93 func (fake *FakeServiceAuthTokenRepository) CreateCallCount() int { 94 fake.createMutex.RLock() 95 defer fake.createMutex.RUnlock() 96 return len(fake.createArgsForCall) 97 } 98 99 func (fake *FakeServiceAuthTokenRepository) CreateCalls(stub func(models.ServiceAuthTokenFields) error) { 100 fake.createMutex.Lock() 101 defer fake.createMutex.Unlock() 102 fake.CreateStub = stub 103 } 104 105 func (fake *FakeServiceAuthTokenRepository) CreateArgsForCall(i int) models.ServiceAuthTokenFields { 106 fake.createMutex.RLock() 107 defer fake.createMutex.RUnlock() 108 argsForCall := fake.createArgsForCall[i] 109 return argsForCall.arg1 110 } 111 112 func (fake *FakeServiceAuthTokenRepository) CreateReturns(result1 error) { 113 fake.createMutex.Lock() 114 defer fake.createMutex.Unlock() 115 fake.CreateStub = nil 116 fake.createReturns = struct { 117 result1 error 118 }{result1} 119 } 120 121 func (fake *FakeServiceAuthTokenRepository) CreateReturnsOnCall(i int, result1 error) { 122 fake.createMutex.Lock() 123 defer fake.createMutex.Unlock() 124 fake.CreateStub = nil 125 if fake.createReturnsOnCall == nil { 126 fake.createReturnsOnCall = make(map[int]struct { 127 result1 error 128 }) 129 } 130 fake.createReturnsOnCall[i] = struct { 131 result1 error 132 }{result1} 133 } 134 135 func (fake *FakeServiceAuthTokenRepository) Delete(arg1 models.ServiceAuthTokenFields) error { 136 fake.deleteMutex.Lock() 137 ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)] 138 fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { 139 arg1 models.ServiceAuthTokenFields 140 }{arg1}) 141 fake.recordInvocation("Delete", []interface{}{arg1}) 142 fake.deleteMutex.Unlock() 143 if fake.DeleteStub != nil { 144 return fake.DeleteStub(arg1) 145 } 146 if specificReturn { 147 return ret.result1 148 } 149 fakeReturns := fake.deleteReturns 150 return fakeReturns.result1 151 } 152 153 func (fake *FakeServiceAuthTokenRepository) DeleteCallCount() int { 154 fake.deleteMutex.RLock() 155 defer fake.deleteMutex.RUnlock() 156 return len(fake.deleteArgsForCall) 157 } 158 159 func (fake *FakeServiceAuthTokenRepository) DeleteCalls(stub func(models.ServiceAuthTokenFields) error) { 160 fake.deleteMutex.Lock() 161 defer fake.deleteMutex.Unlock() 162 fake.DeleteStub = stub 163 } 164 165 func (fake *FakeServiceAuthTokenRepository) DeleteArgsForCall(i int) models.ServiceAuthTokenFields { 166 fake.deleteMutex.RLock() 167 defer fake.deleteMutex.RUnlock() 168 argsForCall := fake.deleteArgsForCall[i] 169 return argsForCall.arg1 170 } 171 172 func (fake *FakeServiceAuthTokenRepository) DeleteReturns(result1 error) { 173 fake.deleteMutex.Lock() 174 defer fake.deleteMutex.Unlock() 175 fake.DeleteStub = nil 176 fake.deleteReturns = struct { 177 result1 error 178 }{result1} 179 } 180 181 func (fake *FakeServiceAuthTokenRepository) DeleteReturnsOnCall(i int, result1 error) { 182 fake.deleteMutex.Lock() 183 defer fake.deleteMutex.Unlock() 184 fake.DeleteStub = nil 185 if fake.deleteReturnsOnCall == nil { 186 fake.deleteReturnsOnCall = make(map[int]struct { 187 result1 error 188 }) 189 } 190 fake.deleteReturnsOnCall[i] = struct { 191 result1 error 192 }{result1} 193 } 194 195 func (fake *FakeServiceAuthTokenRepository) FindAll() ([]models.ServiceAuthTokenFields, error) { 196 fake.findAllMutex.Lock() 197 ret, specificReturn := fake.findAllReturnsOnCall[len(fake.findAllArgsForCall)] 198 fake.findAllArgsForCall = append(fake.findAllArgsForCall, struct { 199 }{}) 200 fake.recordInvocation("FindAll", []interface{}{}) 201 fake.findAllMutex.Unlock() 202 if fake.FindAllStub != nil { 203 return fake.FindAllStub() 204 } 205 if specificReturn { 206 return ret.result1, ret.result2 207 } 208 fakeReturns := fake.findAllReturns 209 return fakeReturns.result1, fakeReturns.result2 210 } 211 212 func (fake *FakeServiceAuthTokenRepository) FindAllCallCount() int { 213 fake.findAllMutex.RLock() 214 defer fake.findAllMutex.RUnlock() 215 return len(fake.findAllArgsForCall) 216 } 217 218 func (fake *FakeServiceAuthTokenRepository) FindAllCalls(stub func() ([]models.ServiceAuthTokenFields, error)) { 219 fake.findAllMutex.Lock() 220 defer fake.findAllMutex.Unlock() 221 fake.FindAllStub = stub 222 } 223 224 func (fake *FakeServiceAuthTokenRepository) FindAllReturns(result1 []models.ServiceAuthTokenFields, result2 error) { 225 fake.findAllMutex.Lock() 226 defer fake.findAllMutex.Unlock() 227 fake.FindAllStub = nil 228 fake.findAllReturns = struct { 229 result1 []models.ServiceAuthTokenFields 230 result2 error 231 }{result1, result2} 232 } 233 234 func (fake *FakeServiceAuthTokenRepository) FindAllReturnsOnCall(i int, result1 []models.ServiceAuthTokenFields, result2 error) { 235 fake.findAllMutex.Lock() 236 defer fake.findAllMutex.Unlock() 237 fake.FindAllStub = nil 238 if fake.findAllReturnsOnCall == nil { 239 fake.findAllReturnsOnCall = make(map[int]struct { 240 result1 []models.ServiceAuthTokenFields 241 result2 error 242 }) 243 } 244 fake.findAllReturnsOnCall[i] = struct { 245 result1 []models.ServiceAuthTokenFields 246 result2 error 247 }{result1, result2} 248 } 249 250 func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProvider(arg1 string, arg2 string) (models.ServiceAuthTokenFields, error) { 251 fake.findByLabelAndProviderMutex.Lock() 252 ret, specificReturn := fake.findByLabelAndProviderReturnsOnCall[len(fake.findByLabelAndProviderArgsForCall)] 253 fake.findByLabelAndProviderArgsForCall = append(fake.findByLabelAndProviderArgsForCall, struct { 254 arg1 string 255 arg2 string 256 }{arg1, arg2}) 257 fake.recordInvocation("FindByLabelAndProvider", []interface{}{arg1, arg2}) 258 fake.findByLabelAndProviderMutex.Unlock() 259 if fake.FindByLabelAndProviderStub != nil { 260 return fake.FindByLabelAndProviderStub(arg1, arg2) 261 } 262 if specificReturn { 263 return ret.result1, ret.result2 264 } 265 fakeReturns := fake.findByLabelAndProviderReturns 266 return fakeReturns.result1, fakeReturns.result2 267 } 268 269 func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderCallCount() int { 270 fake.findByLabelAndProviderMutex.RLock() 271 defer fake.findByLabelAndProviderMutex.RUnlock() 272 return len(fake.findByLabelAndProviderArgsForCall) 273 } 274 275 func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderCalls(stub func(string, string) (models.ServiceAuthTokenFields, error)) { 276 fake.findByLabelAndProviderMutex.Lock() 277 defer fake.findByLabelAndProviderMutex.Unlock() 278 fake.FindByLabelAndProviderStub = stub 279 } 280 281 func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderArgsForCall(i int) (string, string) { 282 fake.findByLabelAndProviderMutex.RLock() 283 defer fake.findByLabelAndProviderMutex.RUnlock() 284 argsForCall := fake.findByLabelAndProviderArgsForCall[i] 285 return argsForCall.arg1, argsForCall.arg2 286 } 287 288 func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderReturns(result1 models.ServiceAuthTokenFields, result2 error) { 289 fake.findByLabelAndProviderMutex.Lock() 290 defer fake.findByLabelAndProviderMutex.Unlock() 291 fake.FindByLabelAndProviderStub = nil 292 fake.findByLabelAndProviderReturns = struct { 293 result1 models.ServiceAuthTokenFields 294 result2 error 295 }{result1, result2} 296 } 297 298 func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderReturnsOnCall(i int, result1 models.ServiceAuthTokenFields, result2 error) { 299 fake.findByLabelAndProviderMutex.Lock() 300 defer fake.findByLabelAndProviderMutex.Unlock() 301 fake.FindByLabelAndProviderStub = nil 302 if fake.findByLabelAndProviderReturnsOnCall == nil { 303 fake.findByLabelAndProviderReturnsOnCall = make(map[int]struct { 304 result1 models.ServiceAuthTokenFields 305 result2 error 306 }) 307 } 308 fake.findByLabelAndProviderReturnsOnCall[i] = struct { 309 result1 models.ServiceAuthTokenFields 310 result2 error 311 }{result1, result2} 312 } 313 314 func (fake *FakeServiceAuthTokenRepository) Update(arg1 models.ServiceAuthTokenFields) error { 315 fake.updateMutex.Lock() 316 ret, specificReturn := fake.updateReturnsOnCall[len(fake.updateArgsForCall)] 317 fake.updateArgsForCall = append(fake.updateArgsForCall, struct { 318 arg1 models.ServiceAuthTokenFields 319 }{arg1}) 320 fake.recordInvocation("Update", []interface{}{arg1}) 321 fake.updateMutex.Unlock() 322 if fake.UpdateStub != nil { 323 return fake.UpdateStub(arg1) 324 } 325 if specificReturn { 326 return ret.result1 327 } 328 fakeReturns := fake.updateReturns 329 return fakeReturns.result1 330 } 331 332 func (fake *FakeServiceAuthTokenRepository) UpdateCallCount() int { 333 fake.updateMutex.RLock() 334 defer fake.updateMutex.RUnlock() 335 return len(fake.updateArgsForCall) 336 } 337 338 func (fake *FakeServiceAuthTokenRepository) UpdateCalls(stub func(models.ServiceAuthTokenFields) error) { 339 fake.updateMutex.Lock() 340 defer fake.updateMutex.Unlock() 341 fake.UpdateStub = stub 342 } 343 344 func (fake *FakeServiceAuthTokenRepository) UpdateArgsForCall(i int) models.ServiceAuthTokenFields { 345 fake.updateMutex.RLock() 346 defer fake.updateMutex.RUnlock() 347 argsForCall := fake.updateArgsForCall[i] 348 return argsForCall.arg1 349 } 350 351 func (fake *FakeServiceAuthTokenRepository) UpdateReturns(result1 error) { 352 fake.updateMutex.Lock() 353 defer fake.updateMutex.Unlock() 354 fake.UpdateStub = nil 355 fake.updateReturns = struct { 356 result1 error 357 }{result1} 358 } 359 360 func (fake *FakeServiceAuthTokenRepository) UpdateReturnsOnCall(i int, result1 error) { 361 fake.updateMutex.Lock() 362 defer fake.updateMutex.Unlock() 363 fake.UpdateStub = nil 364 if fake.updateReturnsOnCall == nil { 365 fake.updateReturnsOnCall = make(map[int]struct { 366 result1 error 367 }) 368 } 369 fake.updateReturnsOnCall[i] = struct { 370 result1 error 371 }{result1} 372 } 373 374 func (fake *FakeServiceAuthTokenRepository) Invocations() map[string][][]interface{} { 375 fake.invocationsMutex.RLock() 376 defer fake.invocationsMutex.RUnlock() 377 fake.createMutex.RLock() 378 defer fake.createMutex.RUnlock() 379 fake.deleteMutex.RLock() 380 defer fake.deleteMutex.RUnlock() 381 fake.findAllMutex.RLock() 382 defer fake.findAllMutex.RUnlock() 383 fake.findByLabelAndProviderMutex.RLock() 384 defer fake.findByLabelAndProviderMutex.RUnlock() 385 fake.updateMutex.RLock() 386 defer fake.updateMutex.RUnlock() 387 copiedInvocations := map[string][][]interface{}{} 388 for key, value := range fake.invocations { 389 copiedInvocations[key] = value 390 } 391 return copiedInvocations 392 } 393 394 func (fake *FakeServiceAuthTokenRepository) recordInvocation(key string, args []interface{}) { 395 fake.invocationsMutex.Lock() 396 defer fake.invocationsMutex.Unlock() 397 if fake.invocations == nil { 398 fake.invocations = map[string][][]interface{}{} 399 } 400 if fake.invocations[key] == nil { 401 fake.invocations[key] = [][]interface{}{} 402 } 403 fake.invocations[key] = append(fake.invocations[key], args) 404 } 405 406 var _ api.ServiceAuthTokenRepository = new(FakeServiceAuthTokenRepository)