1// Code generated by counterfeiter. DO NOT EDIT. 2package dbfakes 3 4import ( 5 "sync" 6 7 "github.com/concourse/concourse/atc/db" 8) 9 10type FakeWorkerArtifactLifecycle struct { 11 RemoveExpiredArtifactsStub func() error 12 removeExpiredArtifactsMutex sync.RWMutex 13 removeExpiredArtifactsArgsForCall []struct { 14 } 15 removeExpiredArtifactsReturns struct { 16 result1 error 17 } 18 removeExpiredArtifactsReturnsOnCall map[int]struct { 19 result1 error 20 } 21 invocations map[string][][]interface{} 22 invocationsMutex sync.RWMutex 23} 24 25func (fake *FakeWorkerArtifactLifecycle) RemoveExpiredArtifacts() error { 26 fake.removeExpiredArtifactsMutex.Lock() 27 ret, specificReturn := fake.removeExpiredArtifactsReturnsOnCall[len(fake.removeExpiredArtifactsArgsForCall)] 28 fake.removeExpiredArtifactsArgsForCall = append(fake.removeExpiredArtifactsArgsForCall, struct { 29 }{}) 30 fake.recordInvocation("RemoveExpiredArtifacts", []interface{}{}) 31 fake.removeExpiredArtifactsMutex.Unlock() 32 if fake.RemoveExpiredArtifactsStub != nil { 33 return fake.RemoveExpiredArtifactsStub() 34 } 35 if specificReturn { 36 return ret.result1 37 } 38 fakeReturns := fake.removeExpiredArtifactsReturns 39 return fakeReturns.result1 40} 41 42func (fake *FakeWorkerArtifactLifecycle) RemoveExpiredArtifactsCallCount() int { 43 fake.removeExpiredArtifactsMutex.RLock() 44 defer fake.removeExpiredArtifactsMutex.RUnlock() 45 return len(fake.removeExpiredArtifactsArgsForCall) 46} 47 48func (fake *FakeWorkerArtifactLifecycle) RemoveExpiredArtifactsCalls(stub func() error) { 49 fake.removeExpiredArtifactsMutex.Lock() 50 defer fake.removeExpiredArtifactsMutex.Unlock() 51 fake.RemoveExpiredArtifactsStub = stub 52} 53 54func (fake *FakeWorkerArtifactLifecycle) RemoveExpiredArtifactsReturns(result1 error) { 55 fake.removeExpiredArtifactsMutex.Lock() 56 defer fake.removeExpiredArtifactsMutex.Unlock() 57 fake.RemoveExpiredArtifactsStub = nil 58 fake.removeExpiredArtifactsReturns = struct { 59 result1 error 60 }{result1} 61} 62 63func (fake *FakeWorkerArtifactLifecycle) RemoveExpiredArtifactsReturnsOnCall(i int, result1 error) { 64 fake.removeExpiredArtifactsMutex.Lock() 65 defer fake.removeExpiredArtifactsMutex.Unlock() 66 fake.RemoveExpiredArtifactsStub = nil 67 if fake.removeExpiredArtifactsReturnsOnCall == nil { 68 fake.removeExpiredArtifactsReturnsOnCall = make(map[int]struct { 69 result1 error 70 }) 71 } 72 fake.removeExpiredArtifactsReturnsOnCall[i] = struct { 73 result1 error 74 }{result1} 75} 76 77func (fake *FakeWorkerArtifactLifecycle) Invocations() map[string][][]interface{} { 78 fake.invocationsMutex.RLock() 79 defer fake.invocationsMutex.RUnlock() 80 fake.removeExpiredArtifactsMutex.RLock() 81 defer fake.removeExpiredArtifactsMutex.RUnlock() 82 copiedInvocations := map[string][][]interface{}{} 83 for key, value := range fake.invocations { 84 copiedInvocations[key] = value 85 } 86 return copiedInvocations 87} 88 89func (fake *FakeWorkerArtifactLifecycle) recordInvocation(key string, args []interface{}) { 90 fake.invocationsMutex.Lock() 91 defer fake.invocationsMutex.Unlock() 92 if fake.invocations == nil { 93 fake.invocations = map[string][][]interface{}{} 94 } 95 if fake.invocations[key] == nil { 96 fake.invocations[key] = [][]interface{}{} 97 } 98 fake.invocations[key] = append(fake.invocations[key], args) 99} 100 101var _ db.WorkerArtifactLifecycle = new(FakeWorkerArtifactLifecycle) 102