1// Code generated by counterfeiter. DO NOT EDIT. 2package dbfakes 3 4import ( 5 "sync" 6 7 "github.com/concourse/concourse/atc" 8 "github.com/concourse/concourse/atc/db" 9) 10 11type FakeTeamFactory struct { 12 CreateDefaultTeamIfNotExistsStub func() (db.Team, error) 13 createDefaultTeamIfNotExistsMutex sync.RWMutex 14 createDefaultTeamIfNotExistsArgsForCall []struct { 15 } 16 createDefaultTeamIfNotExistsReturns struct { 17 result1 db.Team 18 result2 error 19 } 20 createDefaultTeamIfNotExistsReturnsOnCall map[int]struct { 21 result1 db.Team 22 result2 error 23 } 24 CreateTeamStub func(atc.Team) (db.Team, error) 25 createTeamMutex sync.RWMutex 26 createTeamArgsForCall []struct { 27 arg1 atc.Team 28 } 29 createTeamReturns struct { 30 result1 db.Team 31 result2 error 32 } 33 createTeamReturnsOnCall map[int]struct { 34 result1 db.Team 35 result2 error 36 } 37 FindTeamStub func(string) (db.Team, bool, error) 38 findTeamMutex sync.RWMutex 39 findTeamArgsForCall []struct { 40 arg1 string 41 } 42 findTeamReturns struct { 43 result1 db.Team 44 result2 bool 45 result3 error 46 } 47 findTeamReturnsOnCall map[int]struct { 48 result1 db.Team 49 result2 bool 50 result3 error 51 } 52 GetByIDStub func(int) db.Team 53 getByIDMutex sync.RWMutex 54 getByIDArgsForCall []struct { 55 arg1 int 56 } 57 getByIDReturns struct { 58 result1 db.Team 59 } 60 getByIDReturnsOnCall map[int]struct { 61 result1 db.Team 62 } 63 GetTeamsStub func() ([]db.Team, error) 64 getTeamsMutex sync.RWMutex 65 getTeamsArgsForCall []struct { 66 } 67 getTeamsReturns struct { 68 result1 []db.Team 69 result2 error 70 } 71 getTeamsReturnsOnCall map[int]struct { 72 result1 []db.Team 73 result2 error 74 } 75 NotifyCacherStub func() error 76 notifyCacherMutex sync.RWMutex 77 notifyCacherArgsForCall []struct { 78 } 79 notifyCacherReturns struct { 80 result1 error 81 } 82 notifyCacherReturnsOnCall map[int]struct { 83 result1 error 84 } 85 NotifyResourceScannerStub func() error 86 notifyResourceScannerMutex sync.RWMutex 87 notifyResourceScannerArgsForCall []struct { 88 } 89 notifyResourceScannerReturns struct { 90 result1 error 91 } 92 notifyResourceScannerReturnsOnCall map[int]struct { 93 result1 error 94 } 95 invocations map[string][][]interface{} 96 invocationsMutex sync.RWMutex 97} 98 99func (fake *FakeTeamFactory) CreateDefaultTeamIfNotExists() (db.Team, error) { 100 fake.createDefaultTeamIfNotExistsMutex.Lock() 101 ret, specificReturn := fake.createDefaultTeamIfNotExistsReturnsOnCall[len(fake.createDefaultTeamIfNotExistsArgsForCall)] 102 fake.createDefaultTeamIfNotExistsArgsForCall = append(fake.createDefaultTeamIfNotExistsArgsForCall, struct { 103 }{}) 104 fake.recordInvocation("CreateDefaultTeamIfNotExists", []interface{}{}) 105 fake.createDefaultTeamIfNotExistsMutex.Unlock() 106 if fake.CreateDefaultTeamIfNotExistsStub != nil { 107 return fake.CreateDefaultTeamIfNotExistsStub() 108 } 109 if specificReturn { 110 return ret.result1, ret.result2 111 } 112 fakeReturns := fake.createDefaultTeamIfNotExistsReturns 113 return fakeReturns.result1, fakeReturns.result2 114} 115 116func (fake *FakeTeamFactory) CreateDefaultTeamIfNotExistsCallCount() int { 117 fake.createDefaultTeamIfNotExistsMutex.RLock() 118 defer fake.createDefaultTeamIfNotExistsMutex.RUnlock() 119 return len(fake.createDefaultTeamIfNotExistsArgsForCall) 120} 121 122func (fake *FakeTeamFactory) CreateDefaultTeamIfNotExistsCalls(stub func() (db.Team, error)) { 123 fake.createDefaultTeamIfNotExistsMutex.Lock() 124 defer fake.createDefaultTeamIfNotExistsMutex.Unlock() 125 fake.CreateDefaultTeamIfNotExistsStub = stub 126} 127 128func (fake *FakeTeamFactory) CreateDefaultTeamIfNotExistsReturns(result1 db.Team, result2 error) { 129 fake.createDefaultTeamIfNotExistsMutex.Lock() 130 defer fake.createDefaultTeamIfNotExistsMutex.Unlock() 131 fake.CreateDefaultTeamIfNotExistsStub = nil 132 fake.createDefaultTeamIfNotExistsReturns = struct { 133 result1 db.Team 134 result2 error 135 }{result1, result2} 136} 137 138func (fake *FakeTeamFactory) CreateDefaultTeamIfNotExistsReturnsOnCall(i int, result1 db.Team, result2 error) { 139 fake.createDefaultTeamIfNotExistsMutex.Lock() 140 defer fake.createDefaultTeamIfNotExistsMutex.Unlock() 141 fake.CreateDefaultTeamIfNotExistsStub = nil 142 if fake.createDefaultTeamIfNotExistsReturnsOnCall == nil { 143 fake.createDefaultTeamIfNotExistsReturnsOnCall = make(map[int]struct { 144 result1 db.Team 145 result2 error 146 }) 147 } 148 fake.createDefaultTeamIfNotExistsReturnsOnCall[i] = struct { 149 result1 db.Team 150 result2 error 151 }{result1, result2} 152} 153 154func (fake *FakeTeamFactory) CreateTeam(arg1 atc.Team) (db.Team, error) { 155 fake.createTeamMutex.Lock() 156 ret, specificReturn := fake.createTeamReturnsOnCall[len(fake.createTeamArgsForCall)] 157 fake.createTeamArgsForCall = append(fake.createTeamArgsForCall, struct { 158 arg1 atc.Team 159 }{arg1}) 160 fake.recordInvocation("CreateTeam", []interface{}{arg1}) 161 fake.createTeamMutex.Unlock() 162 if fake.CreateTeamStub != nil { 163 return fake.CreateTeamStub(arg1) 164 } 165 if specificReturn { 166 return ret.result1, ret.result2 167 } 168 fakeReturns := fake.createTeamReturns 169 return fakeReturns.result1, fakeReturns.result2 170} 171 172func (fake *FakeTeamFactory) CreateTeamCallCount() int { 173 fake.createTeamMutex.RLock() 174 defer fake.createTeamMutex.RUnlock() 175 return len(fake.createTeamArgsForCall) 176} 177 178func (fake *FakeTeamFactory) CreateTeamCalls(stub func(atc.Team) (db.Team, error)) { 179 fake.createTeamMutex.Lock() 180 defer fake.createTeamMutex.Unlock() 181 fake.CreateTeamStub = stub 182} 183 184func (fake *FakeTeamFactory) CreateTeamArgsForCall(i int) atc.Team { 185 fake.createTeamMutex.RLock() 186 defer fake.createTeamMutex.RUnlock() 187 argsForCall := fake.createTeamArgsForCall[i] 188 return argsForCall.arg1 189} 190 191func (fake *FakeTeamFactory) CreateTeamReturns(result1 db.Team, result2 error) { 192 fake.createTeamMutex.Lock() 193 defer fake.createTeamMutex.Unlock() 194 fake.CreateTeamStub = nil 195 fake.createTeamReturns = struct { 196 result1 db.Team 197 result2 error 198 }{result1, result2} 199} 200 201func (fake *FakeTeamFactory) CreateTeamReturnsOnCall(i int, result1 db.Team, result2 error) { 202 fake.createTeamMutex.Lock() 203 defer fake.createTeamMutex.Unlock() 204 fake.CreateTeamStub = nil 205 if fake.createTeamReturnsOnCall == nil { 206 fake.createTeamReturnsOnCall = make(map[int]struct { 207 result1 db.Team 208 result2 error 209 }) 210 } 211 fake.createTeamReturnsOnCall[i] = struct { 212 result1 db.Team 213 result2 error 214 }{result1, result2} 215} 216 217func (fake *FakeTeamFactory) FindTeam(arg1 string) (db.Team, bool, error) { 218 fake.findTeamMutex.Lock() 219 ret, specificReturn := fake.findTeamReturnsOnCall[len(fake.findTeamArgsForCall)] 220 fake.findTeamArgsForCall = append(fake.findTeamArgsForCall, struct { 221 arg1 string 222 }{arg1}) 223 fake.recordInvocation("FindTeam", []interface{}{arg1}) 224 fake.findTeamMutex.Unlock() 225 if fake.FindTeamStub != nil { 226 return fake.FindTeamStub(arg1) 227 } 228 if specificReturn { 229 return ret.result1, ret.result2, ret.result3 230 } 231 fakeReturns := fake.findTeamReturns 232 return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 233} 234 235func (fake *FakeTeamFactory) FindTeamCallCount() int { 236 fake.findTeamMutex.RLock() 237 defer fake.findTeamMutex.RUnlock() 238 return len(fake.findTeamArgsForCall) 239} 240 241func (fake *FakeTeamFactory) FindTeamCalls(stub func(string) (db.Team, bool, error)) { 242 fake.findTeamMutex.Lock() 243 defer fake.findTeamMutex.Unlock() 244 fake.FindTeamStub = stub 245} 246 247func (fake *FakeTeamFactory) FindTeamArgsForCall(i int) string { 248 fake.findTeamMutex.RLock() 249 defer fake.findTeamMutex.RUnlock() 250 argsForCall := fake.findTeamArgsForCall[i] 251 return argsForCall.arg1 252} 253 254func (fake *FakeTeamFactory) FindTeamReturns(result1 db.Team, result2 bool, result3 error) { 255 fake.findTeamMutex.Lock() 256 defer fake.findTeamMutex.Unlock() 257 fake.FindTeamStub = nil 258 fake.findTeamReturns = struct { 259 result1 db.Team 260 result2 bool 261 result3 error 262 }{result1, result2, result3} 263} 264 265func (fake *FakeTeamFactory) FindTeamReturnsOnCall(i int, result1 db.Team, result2 bool, result3 error) { 266 fake.findTeamMutex.Lock() 267 defer fake.findTeamMutex.Unlock() 268 fake.FindTeamStub = nil 269 if fake.findTeamReturnsOnCall == nil { 270 fake.findTeamReturnsOnCall = make(map[int]struct { 271 result1 db.Team 272 result2 bool 273 result3 error 274 }) 275 } 276 fake.findTeamReturnsOnCall[i] = struct { 277 result1 db.Team 278 result2 bool 279 result3 error 280 }{result1, result2, result3} 281} 282 283func (fake *FakeTeamFactory) GetByID(arg1 int) db.Team { 284 fake.getByIDMutex.Lock() 285 ret, specificReturn := fake.getByIDReturnsOnCall[len(fake.getByIDArgsForCall)] 286 fake.getByIDArgsForCall = append(fake.getByIDArgsForCall, struct { 287 arg1 int 288 }{arg1}) 289 fake.recordInvocation("GetByID", []interface{}{arg1}) 290 fake.getByIDMutex.Unlock() 291 if fake.GetByIDStub != nil { 292 return fake.GetByIDStub(arg1) 293 } 294 if specificReturn { 295 return ret.result1 296 } 297 fakeReturns := fake.getByIDReturns 298 return fakeReturns.result1 299} 300 301func (fake *FakeTeamFactory) GetByIDCallCount() int { 302 fake.getByIDMutex.RLock() 303 defer fake.getByIDMutex.RUnlock() 304 return len(fake.getByIDArgsForCall) 305} 306 307func (fake *FakeTeamFactory) GetByIDCalls(stub func(int) db.Team) { 308 fake.getByIDMutex.Lock() 309 defer fake.getByIDMutex.Unlock() 310 fake.GetByIDStub = stub 311} 312 313func (fake *FakeTeamFactory) GetByIDArgsForCall(i int) int { 314 fake.getByIDMutex.RLock() 315 defer fake.getByIDMutex.RUnlock() 316 argsForCall := fake.getByIDArgsForCall[i] 317 return argsForCall.arg1 318} 319 320func (fake *FakeTeamFactory) GetByIDReturns(result1 db.Team) { 321 fake.getByIDMutex.Lock() 322 defer fake.getByIDMutex.Unlock() 323 fake.GetByIDStub = nil 324 fake.getByIDReturns = struct { 325 result1 db.Team 326 }{result1} 327} 328 329func (fake *FakeTeamFactory) GetByIDReturnsOnCall(i int, result1 db.Team) { 330 fake.getByIDMutex.Lock() 331 defer fake.getByIDMutex.Unlock() 332 fake.GetByIDStub = nil 333 if fake.getByIDReturnsOnCall == nil { 334 fake.getByIDReturnsOnCall = make(map[int]struct { 335 result1 db.Team 336 }) 337 } 338 fake.getByIDReturnsOnCall[i] = struct { 339 result1 db.Team 340 }{result1} 341} 342 343func (fake *FakeTeamFactory) GetTeams() ([]db.Team, error) { 344 fake.getTeamsMutex.Lock() 345 ret, specificReturn := fake.getTeamsReturnsOnCall[len(fake.getTeamsArgsForCall)] 346 fake.getTeamsArgsForCall = append(fake.getTeamsArgsForCall, struct { 347 }{}) 348 fake.recordInvocation("GetTeams", []interface{}{}) 349 fake.getTeamsMutex.Unlock() 350 if fake.GetTeamsStub != nil { 351 return fake.GetTeamsStub() 352 } 353 if specificReturn { 354 return ret.result1, ret.result2 355 } 356 fakeReturns := fake.getTeamsReturns 357 return fakeReturns.result1, fakeReturns.result2 358} 359 360func (fake *FakeTeamFactory) GetTeamsCallCount() int { 361 fake.getTeamsMutex.RLock() 362 defer fake.getTeamsMutex.RUnlock() 363 return len(fake.getTeamsArgsForCall) 364} 365 366func (fake *FakeTeamFactory) GetTeamsCalls(stub func() ([]db.Team, error)) { 367 fake.getTeamsMutex.Lock() 368 defer fake.getTeamsMutex.Unlock() 369 fake.GetTeamsStub = stub 370} 371 372func (fake *FakeTeamFactory) GetTeamsReturns(result1 []db.Team, result2 error) { 373 fake.getTeamsMutex.Lock() 374 defer fake.getTeamsMutex.Unlock() 375 fake.GetTeamsStub = nil 376 fake.getTeamsReturns = struct { 377 result1 []db.Team 378 result2 error 379 }{result1, result2} 380} 381 382func (fake *FakeTeamFactory) GetTeamsReturnsOnCall(i int, result1 []db.Team, result2 error) { 383 fake.getTeamsMutex.Lock() 384 defer fake.getTeamsMutex.Unlock() 385 fake.GetTeamsStub = nil 386 if fake.getTeamsReturnsOnCall == nil { 387 fake.getTeamsReturnsOnCall = make(map[int]struct { 388 result1 []db.Team 389 result2 error 390 }) 391 } 392 fake.getTeamsReturnsOnCall[i] = struct { 393 result1 []db.Team 394 result2 error 395 }{result1, result2} 396} 397 398func (fake *FakeTeamFactory) NotifyCacher() error { 399 fake.notifyCacherMutex.Lock() 400 ret, specificReturn := fake.notifyCacherReturnsOnCall[len(fake.notifyCacherArgsForCall)] 401 fake.notifyCacherArgsForCall = append(fake.notifyCacherArgsForCall, struct { 402 }{}) 403 fake.recordInvocation("NotifyCacher", []interface{}{}) 404 fake.notifyCacherMutex.Unlock() 405 if fake.NotifyCacherStub != nil { 406 return fake.NotifyCacherStub() 407 } 408 if specificReturn { 409 return ret.result1 410 } 411 fakeReturns := fake.notifyCacherReturns 412 return fakeReturns.result1 413} 414 415func (fake *FakeTeamFactory) NotifyCacherCallCount() int { 416 fake.notifyCacherMutex.RLock() 417 defer fake.notifyCacherMutex.RUnlock() 418 return len(fake.notifyCacherArgsForCall) 419} 420 421func (fake *FakeTeamFactory) NotifyCacherCalls(stub func() error) { 422 fake.notifyCacherMutex.Lock() 423 defer fake.notifyCacherMutex.Unlock() 424 fake.NotifyCacherStub = stub 425} 426 427func (fake *FakeTeamFactory) NotifyCacherReturns(result1 error) { 428 fake.notifyCacherMutex.Lock() 429 defer fake.notifyCacherMutex.Unlock() 430 fake.NotifyCacherStub = nil 431 fake.notifyCacherReturns = struct { 432 result1 error 433 }{result1} 434} 435 436func (fake *FakeTeamFactory) NotifyCacherReturnsOnCall(i int, result1 error) { 437 fake.notifyCacherMutex.Lock() 438 defer fake.notifyCacherMutex.Unlock() 439 fake.NotifyCacherStub = nil 440 if fake.notifyCacherReturnsOnCall == nil { 441 fake.notifyCacherReturnsOnCall = make(map[int]struct { 442 result1 error 443 }) 444 } 445 fake.notifyCacherReturnsOnCall[i] = struct { 446 result1 error 447 }{result1} 448} 449 450func (fake *FakeTeamFactory) NotifyResourceScanner() error { 451 fake.notifyResourceScannerMutex.Lock() 452 ret, specificReturn := fake.notifyResourceScannerReturnsOnCall[len(fake.notifyResourceScannerArgsForCall)] 453 fake.notifyResourceScannerArgsForCall = append(fake.notifyResourceScannerArgsForCall, struct { 454 }{}) 455 fake.recordInvocation("NotifyResourceScanner", []interface{}{}) 456 fake.notifyResourceScannerMutex.Unlock() 457 if fake.NotifyResourceScannerStub != nil { 458 return fake.NotifyResourceScannerStub() 459 } 460 if specificReturn { 461 return ret.result1 462 } 463 fakeReturns := fake.notifyResourceScannerReturns 464 return fakeReturns.result1 465} 466 467func (fake *FakeTeamFactory) NotifyResourceScannerCallCount() int { 468 fake.notifyResourceScannerMutex.RLock() 469 defer fake.notifyResourceScannerMutex.RUnlock() 470 return len(fake.notifyResourceScannerArgsForCall) 471} 472 473func (fake *FakeTeamFactory) NotifyResourceScannerCalls(stub func() error) { 474 fake.notifyResourceScannerMutex.Lock() 475 defer fake.notifyResourceScannerMutex.Unlock() 476 fake.NotifyResourceScannerStub = stub 477} 478 479func (fake *FakeTeamFactory) NotifyResourceScannerReturns(result1 error) { 480 fake.notifyResourceScannerMutex.Lock() 481 defer fake.notifyResourceScannerMutex.Unlock() 482 fake.NotifyResourceScannerStub = nil 483 fake.notifyResourceScannerReturns = struct { 484 result1 error 485 }{result1} 486} 487 488func (fake *FakeTeamFactory) NotifyResourceScannerReturnsOnCall(i int, result1 error) { 489 fake.notifyResourceScannerMutex.Lock() 490 defer fake.notifyResourceScannerMutex.Unlock() 491 fake.NotifyResourceScannerStub = nil 492 if fake.notifyResourceScannerReturnsOnCall == nil { 493 fake.notifyResourceScannerReturnsOnCall = make(map[int]struct { 494 result1 error 495 }) 496 } 497 fake.notifyResourceScannerReturnsOnCall[i] = struct { 498 result1 error 499 }{result1} 500} 501 502func (fake *FakeTeamFactory) Invocations() map[string][][]interface{} { 503 fake.invocationsMutex.RLock() 504 defer fake.invocationsMutex.RUnlock() 505 fake.createDefaultTeamIfNotExistsMutex.RLock() 506 defer fake.createDefaultTeamIfNotExistsMutex.RUnlock() 507 fake.createTeamMutex.RLock() 508 defer fake.createTeamMutex.RUnlock() 509 fake.findTeamMutex.RLock() 510 defer fake.findTeamMutex.RUnlock() 511 fake.getByIDMutex.RLock() 512 defer fake.getByIDMutex.RUnlock() 513 fake.getTeamsMutex.RLock() 514 defer fake.getTeamsMutex.RUnlock() 515 fake.notifyCacherMutex.RLock() 516 defer fake.notifyCacherMutex.RUnlock() 517 fake.notifyResourceScannerMutex.RLock() 518 defer fake.notifyResourceScannerMutex.RUnlock() 519 copiedInvocations := map[string][][]interface{}{} 520 for key, value := range fake.invocations { 521 copiedInvocations[key] = value 522 } 523 return copiedInvocations 524} 525 526func (fake *FakeTeamFactory) recordInvocation(key string, args []interface{}) { 527 fake.invocationsMutex.Lock() 528 defer fake.invocationsMutex.Unlock() 529 if fake.invocations == nil { 530 fake.invocations = map[string][][]interface{}{} 531 } 532 if fake.invocations[key] == nil { 533 fake.invocations[key] = [][]interface{}{} 534 } 535 fake.invocations[key] = append(fake.invocations[key], args) 536} 537 538var _ db.TeamFactory = new(FakeTeamFactory) 539