github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/api/apifakes/fake_buildpack_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 FakeBuildpackRepository struct { 12 CreateStub func(string, *int, *bool, *bool) (models.Buildpack, error) 13 createMutex sync.RWMutex 14 createArgsForCall []struct { 15 arg1 string 16 arg2 *int 17 arg3 *bool 18 arg4 *bool 19 } 20 createReturns struct { 21 result1 models.Buildpack 22 result2 error 23 } 24 createReturnsOnCall map[int]struct { 25 result1 models.Buildpack 26 result2 error 27 } 28 DeleteStub func(string) error 29 deleteMutex sync.RWMutex 30 deleteArgsForCall []struct { 31 arg1 string 32 } 33 deleteReturns struct { 34 result1 error 35 } 36 deleteReturnsOnCall map[int]struct { 37 result1 error 38 } 39 FindByNameStub func(string) (models.Buildpack, error) 40 findByNameMutex sync.RWMutex 41 findByNameArgsForCall []struct { 42 arg1 string 43 } 44 findByNameReturns struct { 45 result1 models.Buildpack 46 result2 error 47 } 48 findByNameReturnsOnCall map[int]struct { 49 result1 models.Buildpack 50 result2 error 51 } 52 FindByNameAndStackStub func(string, string) (models.Buildpack, error) 53 findByNameAndStackMutex sync.RWMutex 54 findByNameAndStackArgsForCall []struct { 55 arg1 string 56 arg2 string 57 } 58 findByNameAndStackReturns struct { 59 result1 models.Buildpack 60 result2 error 61 } 62 findByNameAndStackReturnsOnCall map[int]struct { 63 result1 models.Buildpack 64 result2 error 65 } 66 FindByNameWithNilStackStub func(string) (models.Buildpack, error) 67 findByNameWithNilStackMutex sync.RWMutex 68 findByNameWithNilStackArgsForCall []struct { 69 arg1 string 70 } 71 findByNameWithNilStackReturns struct { 72 result1 models.Buildpack 73 result2 error 74 } 75 findByNameWithNilStackReturnsOnCall map[int]struct { 76 result1 models.Buildpack 77 result2 error 78 } 79 ListBuildpacksStub func(func(models.Buildpack) bool) error 80 listBuildpacksMutex sync.RWMutex 81 listBuildpacksArgsForCall []struct { 82 arg1 func(models.Buildpack) bool 83 } 84 listBuildpacksReturns struct { 85 result1 error 86 } 87 listBuildpacksReturnsOnCall map[int]struct { 88 result1 error 89 } 90 UpdateStub func(models.Buildpack) (models.Buildpack, error) 91 updateMutex sync.RWMutex 92 updateArgsForCall []struct { 93 arg1 models.Buildpack 94 } 95 updateReturns struct { 96 result1 models.Buildpack 97 result2 error 98 } 99 updateReturnsOnCall map[int]struct { 100 result1 models.Buildpack 101 result2 error 102 } 103 invocations map[string][][]interface{} 104 invocationsMutex sync.RWMutex 105 } 106 107 func (fake *FakeBuildpackRepository) Create(arg1 string, arg2 *int, arg3 *bool, arg4 *bool) (models.Buildpack, error) { 108 fake.createMutex.Lock() 109 ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)] 110 fake.createArgsForCall = append(fake.createArgsForCall, struct { 111 arg1 string 112 arg2 *int 113 arg3 *bool 114 arg4 *bool 115 }{arg1, arg2, arg3, arg4}) 116 fake.recordInvocation("Create", []interface{}{arg1, arg2, arg3, arg4}) 117 fake.createMutex.Unlock() 118 if fake.CreateStub != nil { 119 return fake.CreateStub(arg1, arg2, arg3, arg4) 120 } 121 if specificReturn { 122 return ret.result1, ret.result2 123 } 124 fakeReturns := fake.createReturns 125 return fakeReturns.result1, fakeReturns.result2 126 } 127 128 func (fake *FakeBuildpackRepository) CreateCallCount() int { 129 fake.createMutex.RLock() 130 defer fake.createMutex.RUnlock() 131 return len(fake.createArgsForCall) 132 } 133 134 func (fake *FakeBuildpackRepository) CreateCalls(stub func(string, *int, *bool, *bool) (models.Buildpack, error)) { 135 fake.createMutex.Lock() 136 defer fake.createMutex.Unlock() 137 fake.CreateStub = stub 138 } 139 140 func (fake *FakeBuildpackRepository) CreateArgsForCall(i int) (string, *int, *bool, *bool) { 141 fake.createMutex.RLock() 142 defer fake.createMutex.RUnlock() 143 argsForCall := fake.createArgsForCall[i] 144 return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4 145 } 146 147 func (fake *FakeBuildpackRepository) CreateReturns(result1 models.Buildpack, result2 error) { 148 fake.createMutex.Lock() 149 defer fake.createMutex.Unlock() 150 fake.CreateStub = nil 151 fake.createReturns = struct { 152 result1 models.Buildpack 153 result2 error 154 }{result1, result2} 155 } 156 157 func (fake *FakeBuildpackRepository) CreateReturnsOnCall(i int, result1 models.Buildpack, result2 error) { 158 fake.createMutex.Lock() 159 defer fake.createMutex.Unlock() 160 fake.CreateStub = nil 161 if fake.createReturnsOnCall == nil { 162 fake.createReturnsOnCall = make(map[int]struct { 163 result1 models.Buildpack 164 result2 error 165 }) 166 } 167 fake.createReturnsOnCall[i] = struct { 168 result1 models.Buildpack 169 result2 error 170 }{result1, result2} 171 } 172 173 func (fake *FakeBuildpackRepository) Delete(arg1 string) error { 174 fake.deleteMutex.Lock() 175 ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)] 176 fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { 177 arg1 string 178 }{arg1}) 179 fake.recordInvocation("Delete", []interface{}{arg1}) 180 fake.deleteMutex.Unlock() 181 if fake.DeleteStub != nil { 182 return fake.DeleteStub(arg1) 183 } 184 if specificReturn { 185 return ret.result1 186 } 187 fakeReturns := fake.deleteReturns 188 return fakeReturns.result1 189 } 190 191 func (fake *FakeBuildpackRepository) DeleteCallCount() int { 192 fake.deleteMutex.RLock() 193 defer fake.deleteMutex.RUnlock() 194 return len(fake.deleteArgsForCall) 195 } 196 197 func (fake *FakeBuildpackRepository) DeleteCalls(stub func(string) error) { 198 fake.deleteMutex.Lock() 199 defer fake.deleteMutex.Unlock() 200 fake.DeleteStub = stub 201 } 202 203 func (fake *FakeBuildpackRepository) DeleteArgsForCall(i int) string { 204 fake.deleteMutex.RLock() 205 defer fake.deleteMutex.RUnlock() 206 argsForCall := fake.deleteArgsForCall[i] 207 return argsForCall.arg1 208 } 209 210 func (fake *FakeBuildpackRepository) DeleteReturns(result1 error) { 211 fake.deleteMutex.Lock() 212 defer fake.deleteMutex.Unlock() 213 fake.DeleteStub = nil 214 fake.deleteReturns = struct { 215 result1 error 216 }{result1} 217 } 218 219 func (fake *FakeBuildpackRepository) DeleteReturnsOnCall(i int, result1 error) { 220 fake.deleteMutex.Lock() 221 defer fake.deleteMutex.Unlock() 222 fake.DeleteStub = nil 223 if fake.deleteReturnsOnCall == nil { 224 fake.deleteReturnsOnCall = make(map[int]struct { 225 result1 error 226 }) 227 } 228 fake.deleteReturnsOnCall[i] = struct { 229 result1 error 230 }{result1} 231 } 232 233 func (fake *FakeBuildpackRepository) FindByName(arg1 string) (models.Buildpack, error) { 234 fake.findByNameMutex.Lock() 235 ret, specificReturn := fake.findByNameReturnsOnCall[len(fake.findByNameArgsForCall)] 236 fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct { 237 arg1 string 238 }{arg1}) 239 fake.recordInvocation("FindByName", []interface{}{arg1}) 240 fake.findByNameMutex.Unlock() 241 if fake.FindByNameStub != nil { 242 return fake.FindByNameStub(arg1) 243 } 244 if specificReturn { 245 return ret.result1, ret.result2 246 } 247 fakeReturns := fake.findByNameReturns 248 return fakeReturns.result1, fakeReturns.result2 249 } 250 251 func (fake *FakeBuildpackRepository) FindByNameCallCount() int { 252 fake.findByNameMutex.RLock() 253 defer fake.findByNameMutex.RUnlock() 254 return len(fake.findByNameArgsForCall) 255 } 256 257 func (fake *FakeBuildpackRepository) FindByNameCalls(stub func(string) (models.Buildpack, error)) { 258 fake.findByNameMutex.Lock() 259 defer fake.findByNameMutex.Unlock() 260 fake.FindByNameStub = stub 261 } 262 263 func (fake *FakeBuildpackRepository) FindByNameArgsForCall(i int) string { 264 fake.findByNameMutex.RLock() 265 defer fake.findByNameMutex.RUnlock() 266 argsForCall := fake.findByNameArgsForCall[i] 267 return argsForCall.arg1 268 } 269 270 func (fake *FakeBuildpackRepository) FindByNameReturns(result1 models.Buildpack, result2 error) { 271 fake.findByNameMutex.Lock() 272 defer fake.findByNameMutex.Unlock() 273 fake.FindByNameStub = nil 274 fake.findByNameReturns = struct { 275 result1 models.Buildpack 276 result2 error 277 }{result1, result2} 278 } 279 280 func (fake *FakeBuildpackRepository) FindByNameReturnsOnCall(i int, result1 models.Buildpack, result2 error) { 281 fake.findByNameMutex.Lock() 282 defer fake.findByNameMutex.Unlock() 283 fake.FindByNameStub = nil 284 if fake.findByNameReturnsOnCall == nil { 285 fake.findByNameReturnsOnCall = make(map[int]struct { 286 result1 models.Buildpack 287 result2 error 288 }) 289 } 290 fake.findByNameReturnsOnCall[i] = struct { 291 result1 models.Buildpack 292 result2 error 293 }{result1, result2} 294 } 295 296 func (fake *FakeBuildpackRepository) FindByNameAndStack(arg1 string, arg2 string) (models.Buildpack, error) { 297 fake.findByNameAndStackMutex.Lock() 298 ret, specificReturn := fake.findByNameAndStackReturnsOnCall[len(fake.findByNameAndStackArgsForCall)] 299 fake.findByNameAndStackArgsForCall = append(fake.findByNameAndStackArgsForCall, struct { 300 arg1 string 301 arg2 string 302 }{arg1, arg2}) 303 fake.recordInvocation("FindByNameAndStack", []interface{}{arg1, arg2}) 304 fake.findByNameAndStackMutex.Unlock() 305 if fake.FindByNameAndStackStub != nil { 306 return fake.FindByNameAndStackStub(arg1, arg2) 307 } 308 if specificReturn { 309 return ret.result1, ret.result2 310 } 311 fakeReturns := fake.findByNameAndStackReturns 312 return fakeReturns.result1, fakeReturns.result2 313 } 314 315 func (fake *FakeBuildpackRepository) FindByNameAndStackCallCount() int { 316 fake.findByNameAndStackMutex.RLock() 317 defer fake.findByNameAndStackMutex.RUnlock() 318 return len(fake.findByNameAndStackArgsForCall) 319 } 320 321 func (fake *FakeBuildpackRepository) FindByNameAndStackCalls(stub func(string, string) (models.Buildpack, error)) { 322 fake.findByNameAndStackMutex.Lock() 323 defer fake.findByNameAndStackMutex.Unlock() 324 fake.FindByNameAndStackStub = stub 325 } 326 327 func (fake *FakeBuildpackRepository) FindByNameAndStackArgsForCall(i int) (string, string) { 328 fake.findByNameAndStackMutex.RLock() 329 defer fake.findByNameAndStackMutex.RUnlock() 330 argsForCall := fake.findByNameAndStackArgsForCall[i] 331 return argsForCall.arg1, argsForCall.arg2 332 } 333 334 func (fake *FakeBuildpackRepository) FindByNameAndStackReturns(result1 models.Buildpack, result2 error) { 335 fake.findByNameAndStackMutex.Lock() 336 defer fake.findByNameAndStackMutex.Unlock() 337 fake.FindByNameAndStackStub = nil 338 fake.findByNameAndStackReturns = struct { 339 result1 models.Buildpack 340 result2 error 341 }{result1, result2} 342 } 343 344 func (fake *FakeBuildpackRepository) FindByNameAndStackReturnsOnCall(i int, result1 models.Buildpack, result2 error) { 345 fake.findByNameAndStackMutex.Lock() 346 defer fake.findByNameAndStackMutex.Unlock() 347 fake.FindByNameAndStackStub = nil 348 if fake.findByNameAndStackReturnsOnCall == nil { 349 fake.findByNameAndStackReturnsOnCall = make(map[int]struct { 350 result1 models.Buildpack 351 result2 error 352 }) 353 } 354 fake.findByNameAndStackReturnsOnCall[i] = struct { 355 result1 models.Buildpack 356 result2 error 357 }{result1, result2} 358 } 359 360 func (fake *FakeBuildpackRepository) FindByNameWithNilStack(arg1 string) (models.Buildpack, error) { 361 fake.findByNameWithNilStackMutex.Lock() 362 ret, specificReturn := fake.findByNameWithNilStackReturnsOnCall[len(fake.findByNameWithNilStackArgsForCall)] 363 fake.findByNameWithNilStackArgsForCall = append(fake.findByNameWithNilStackArgsForCall, struct { 364 arg1 string 365 }{arg1}) 366 fake.recordInvocation("FindByNameWithNilStack", []interface{}{arg1}) 367 fake.findByNameWithNilStackMutex.Unlock() 368 if fake.FindByNameWithNilStackStub != nil { 369 return fake.FindByNameWithNilStackStub(arg1) 370 } 371 if specificReturn { 372 return ret.result1, ret.result2 373 } 374 fakeReturns := fake.findByNameWithNilStackReturns 375 return fakeReturns.result1, fakeReturns.result2 376 } 377 378 func (fake *FakeBuildpackRepository) FindByNameWithNilStackCallCount() int { 379 fake.findByNameWithNilStackMutex.RLock() 380 defer fake.findByNameWithNilStackMutex.RUnlock() 381 return len(fake.findByNameWithNilStackArgsForCall) 382 } 383 384 func (fake *FakeBuildpackRepository) FindByNameWithNilStackCalls(stub func(string) (models.Buildpack, error)) { 385 fake.findByNameWithNilStackMutex.Lock() 386 defer fake.findByNameWithNilStackMutex.Unlock() 387 fake.FindByNameWithNilStackStub = stub 388 } 389 390 func (fake *FakeBuildpackRepository) FindByNameWithNilStackArgsForCall(i int) string { 391 fake.findByNameWithNilStackMutex.RLock() 392 defer fake.findByNameWithNilStackMutex.RUnlock() 393 argsForCall := fake.findByNameWithNilStackArgsForCall[i] 394 return argsForCall.arg1 395 } 396 397 func (fake *FakeBuildpackRepository) FindByNameWithNilStackReturns(result1 models.Buildpack, result2 error) { 398 fake.findByNameWithNilStackMutex.Lock() 399 defer fake.findByNameWithNilStackMutex.Unlock() 400 fake.FindByNameWithNilStackStub = nil 401 fake.findByNameWithNilStackReturns = struct { 402 result1 models.Buildpack 403 result2 error 404 }{result1, result2} 405 } 406 407 func (fake *FakeBuildpackRepository) FindByNameWithNilStackReturnsOnCall(i int, result1 models.Buildpack, result2 error) { 408 fake.findByNameWithNilStackMutex.Lock() 409 defer fake.findByNameWithNilStackMutex.Unlock() 410 fake.FindByNameWithNilStackStub = nil 411 if fake.findByNameWithNilStackReturnsOnCall == nil { 412 fake.findByNameWithNilStackReturnsOnCall = make(map[int]struct { 413 result1 models.Buildpack 414 result2 error 415 }) 416 } 417 fake.findByNameWithNilStackReturnsOnCall[i] = struct { 418 result1 models.Buildpack 419 result2 error 420 }{result1, result2} 421 } 422 423 func (fake *FakeBuildpackRepository) ListBuildpacks(arg1 func(models.Buildpack) bool) error { 424 fake.listBuildpacksMutex.Lock() 425 ret, specificReturn := fake.listBuildpacksReturnsOnCall[len(fake.listBuildpacksArgsForCall)] 426 fake.listBuildpacksArgsForCall = append(fake.listBuildpacksArgsForCall, struct { 427 arg1 func(models.Buildpack) bool 428 }{arg1}) 429 fake.recordInvocation("ListBuildpacks", []interface{}{arg1}) 430 fake.listBuildpacksMutex.Unlock() 431 if fake.ListBuildpacksStub != nil { 432 return fake.ListBuildpacksStub(arg1) 433 } 434 if specificReturn { 435 return ret.result1 436 } 437 fakeReturns := fake.listBuildpacksReturns 438 return fakeReturns.result1 439 } 440 441 func (fake *FakeBuildpackRepository) ListBuildpacksCallCount() int { 442 fake.listBuildpacksMutex.RLock() 443 defer fake.listBuildpacksMutex.RUnlock() 444 return len(fake.listBuildpacksArgsForCall) 445 } 446 447 func (fake *FakeBuildpackRepository) ListBuildpacksCalls(stub func(func(models.Buildpack) bool) error) { 448 fake.listBuildpacksMutex.Lock() 449 defer fake.listBuildpacksMutex.Unlock() 450 fake.ListBuildpacksStub = stub 451 } 452 453 func (fake *FakeBuildpackRepository) ListBuildpacksArgsForCall(i int) func(models.Buildpack) bool { 454 fake.listBuildpacksMutex.RLock() 455 defer fake.listBuildpacksMutex.RUnlock() 456 argsForCall := fake.listBuildpacksArgsForCall[i] 457 return argsForCall.arg1 458 } 459 460 func (fake *FakeBuildpackRepository) ListBuildpacksReturns(result1 error) { 461 fake.listBuildpacksMutex.Lock() 462 defer fake.listBuildpacksMutex.Unlock() 463 fake.ListBuildpacksStub = nil 464 fake.listBuildpacksReturns = struct { 465 result1 error 466 }{result1} 467 } 468 469 func (fake *FakeBuildpackRepository) ListBuildpacksReturnsOnCall(i int, result1 error) { 470 fake.listBuildpacksMutex.Lock() 471 defer fake.listBuildpacksMutex.Unlock() 472 fake.ListBuildpacksStub = nil 473 if fake.listBuildpacksReturnsOnCall == nil { 474 fake.listBuildpacksReturnsOnCall = make(map[int]struct { 475 result1 error 476 }) 477 } 478 fake.listBuildpacksReturnsOnCall[i] = struct { 479 result1 error 480 }{result1} 481 } 482 483 func (fake *FakeBuildpackRepository) Update(arg1 models.Buildpack) (models.Buildpack, error) { 484 fake.updateMutex.Lock() 485 ret, specificReturn := fake.updateReturnsOnCall[len(fake.updateArgsForCall)] 486 fake.updateArgsForCall = append(fake.updateArgsForCall, struct { 487 arg1 models.Buildpack 488 }{arg1}) 489 fake.recordInvocation("Update", []interface{}{arg1}) 490 fake.updateMutex.Unlock() 491 if fake.UpdateStub != nil { 492 return fake.UpdateStub(arg1) 493 } 494 if specificReturn { 495 return ret.result1, ret.result2 496 } 497 fakeReturns := fake.updateReturns 498 return fakeReturns.result1, fakeReturns.result2 499 } 500 501 func (fake *FakeBuildpackRepository) UpdateCallCount() int { 502 fake.updateMutex.RLock() 503 defer fake.updateMutex.RUnlock() 504 return len(fake.updateArgsForCall) 505 } 506 507 func (fake *FakeBuildpackRepository) UpdateCalls(stub func(models.Buildpack) (models.Buildpack, error)) { 508 fake.updateMutex.Lock() 509 defer fake.updateMutex.Unlock() 510 fake.UpdateStub = stub 511 } 512 513 func (fake *FakeBuildpackRepository) UpdateArgsForCall(i int) models.Buildpack { 514 fake.updateMutex.RLock() 515 defer fake.updateMutex.RUnlock() 516 argsForCall := fake.updateArgsForCall[i] 517 return argsForCall.arg1 518 } 519 520 func (fake *FakeBuildpackRepository) UpdateReturns(result1 models.Buildpack, result2 error) { 521 fake.updateMutex.Lock() 522 defer fake.updateMutex.Unlock() 523 fake.UpdateStub = nil 524 fake.updateReturns = struct { 525 result1 models.Buildpack 526 result2 error 527 }{result1, result2} 528 } 529 530 func (fake *FakeBuildpackRepository) UpdateReturnsOnCall(i int, result1 models.Buildpack, result2 error) { 531 fake.updateMutex.Lock() 532 defer fake.updateMutex.Unlock() 533 fake.UpdateStub = nil 534 if fake.updateReturnsOnCall == nil { 535 fake.updateReturnsOnCall = make(map[int]struct { 536 result1 models.Buildpack 537 result2 error 538 }) 539 } 540 fake.updateReturnsOnCall[i] = struct { 541 result1 models.Buildpack 542 result2 error 543 }{result1, result2} 544 } 545 546 func (fake *FakeBuildpackRepository) Invocations() map[string][][]interface{} { 547 fake.invocationsMutex.RLock() 548 defer fake.invocationsMutex.RUnlock() 549 fake.createMutex.RLock() 550 defer fake.createMutex.RUnlock() 551 fake.deleteMutex.RLock() 552 defer fake.deleteMutex.RUnlock() 553 fake.findByNameMutex.RLock() 554 defer fake.findByNameMutex.RUnlock() 555 fake.findByNameAndStackMutex.RLock() 556 defer fake.findByNameAndStackMutex.RUnlock() 557 fake.findByNameWithNilStackMutex.RLock() 558 defer fake.findByNameWithNilStackMutex.RUnlock() 559 fake.listBuildpacksMutex.RLock() 560 defer fake.listBuildpacksMutex.RUnlock() 561 fake.updateMutex.RLock() 562 defer fake.updateMutex.RUnlock() 563 copiedInvocations := map[string][][]interface{}{} 564 for key, value := range fake.invocations { 565 copiedInvocations[key] = value 566 } 567 return copiedInvocations 568 } 569 570 func (fake *FakeBuildpackRepository) recordInvocation(key string, args []interface{}) { 571 fake.invocationsMutex.Lock() 572 defer fake.invocationsMutex.Unlock() 573 if fake.invocations == nil { 574 fake.invocations = map[string][][]interface{}{} 575 } 576 if fake.invocations[key] == nil { 577 fake.invocations[key] = [][]interface{}{} 578 } 579 fake.invocations[key] = append(fake.invocations[key], args) 580 } 581 582 var _ api.BuildpackRepository = new(FakeBuildpackRepository)