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 FakePipelineLifecycle struct { 11 ArchiveAbandonedPipelinesStub func() error 12 archiveAbandonedPipelinesMutex sync.RWMutex 13 archiveAbandonedPipelinesArgsForCall []struct { 14 } 15 archiveAbandonedPipelinesReturns struct { 16 result1 error 17 } 18 archiveAbandonedPipelinesReturnsOnCall map[int]struct { 19 result1 error 20 } 21 RemoveBuildEventsForDeletedPipelinesStub func() error 22 removeBuildEventsForDeletedPipelinesMutex sync.RWMutex 23 removeBuildEventsForDeletedPipelinesArgsForCall []struct { 24 } 25 removeBuildEventsForDeletedPipelinesReturns struct { 26 result1 error 27 } 28 removeBuildEventsForDeletedPipelinesReturnsOnCall map[int]struct { 29 result1 error 30 } 31 invocations map[string][][]interface{} 32 invocationsMutex sync.RWMutex 33} 34 35func (fake *FakePipelineLifecycle) ArchiveAbandonedPipelines() error { 36 fake.archiveAbandonedPipelinesMutex.Lock() 37 ret, specificReturn := fake.archiveAbandonedPipelinesReturnsOnCall[len(fake.archiveAbandonedPipelinesArgsForCall)] 38 fake.archiveAbandonedPipelinesArgsForCall = append(fake.archiveAbandonedPipelinesArgsForCall, struct { 39 }{}) 40 fake.recordInvocation("ArchiveAbandonedPipelines", []interface{}{}) 41 fake.archiveAbandonedPipelinesMutex.Unlock() 42 if fake.ArchiveAbandonedPipelinesStub != nil { 43 return fake.ArchiveAbandonedPipelinesStub() 44 } 45 if specificReturn { 46 return ret.result1 47 } 48 fakeReturns := fake.archiveAbandonedPipelinesReturns 49 return fakeReturns.result1 50} 51 52func (fake *FakePipelineLifecycle) ArchiveAbandonedPipelinesCallCount() int { 53 fake.archiveAbandonedPipelinesMutex.RLock() 54 defer fake.archiveAbandonedPipelinesMutex.RUnlock() 55 return len(fake.archiveAbandonedPipelinesArgsForCall) 56} 57 58func (fake *FakePipelineLifecycle) ArchiveAbandonedPipelinesCalls(stub func() error) { 59 fake.archiveAbandonedPipelinesMutex.Lock() 60 defer fake.archiveAbandonedPipelinesMutex.Unlock() 61 fake.ArchiveAbandonedPipelinesStub = stub 62} 63 64func (fake *FakePipelineLifecycle) ArchiveAbandonedPipelinesReturns(result1 error) { 65 fake.archiveAbandonedPipelinesMutex.Lock() 66 defer fake.archiveAbandonedPipelinesMutex.Unlock() 67 fake.ArchiveAbandonedPipelinesStub = nil 68 fake.archiveAbandonedPipelinesReturns = struct { 69 result1 error 70 }{result1} 71} 72 73func (fake *FakePipelineLifecycle) ArchiveAbandonedPipelinesReturnsOnCall(i int, result1 error) { 74 fake.archiveAbandonedPipelinesMutex.Lock() 75 defer fake.archiveAbandonedPipelinesMutex.Unlock() 76 fake.ArchiveAbandonedPipelinesStub = nil 77 if fake.archiveAbandonedPipelinesReturnsOnCall == nil { 78 fake.archiveAbandonedPipelinesReturnsOnCall = make(map[int]struct { 79 result1 error 80 }) 81 } 82 fake.archiveAbandonedPipelinesReturnsOnCall[i] = struct { 83 result1 error 84 }{result1} 85} 86 87func (fake *FakePipelineLifecycle) RemoveBuildEventsForDeletedPipelines() error { 88 fake.removeBuildEventsForDeletedPipelinesMutex.Lock() 89 ret, specificReturn := fake.removeBuildEventsForDeletedPipelinesReturnsOnCall[len(fake.removeBuildEventsForDeletedPipelinesArgsForCall)] 90 fake.removeBuildEventsForDeletedPipelinesArgsForCall = append(fake.removeBuildEventsForDeletedPipelinesArgsForCall, struct { 91 }{}) 92 fake.recordInvocation("RemoveBuildEventsForDeletedPipelines", []interface{}{}) 93 fake.removeBuildEventsForDeletedPipelinesMutex.Unlock() 94 if fake.RemoveBuildEventsForDeletedPipelinesStub != nil { 95 return fake.RemoveBuildEventsForDeletedPipelinesStub() 96 } 97 if specificReturn { 98 return ret.result1 99 } 100 fakeReturns := fake.removeBuildEventsForDeletedPipelinesReturns 101 return fakeReturns.result1 102} 103 104func (fake *FakePipelineLifecycle) RemoveBuildEventsForDeletedPipelinesCallCount() int { 105 fake.removeBuildEventsForDeletedPipelinesMutex.RLock() 106 defer fake.removeBuildEventsForDeletedPipelinesMutex.RUnlock() 107 return len(fake.removeBuildEventsForDeletedPipelinesArgsForCall) 108} 109 110func (fake *FakePipelineLifecycle) RemoveBuildEventsForDeletedPipelinesCalls(stub func() error) { 111 fake.removeBuildEventsForDeletedPipelinesMutex.Lock() 112 defer fake.removeBuildEventsForDeletedPipelinesMutex.Unlock() 113 fake.RemoveBuildEventsForDeletedPipelinesStub = stub 114} 115 116func (fake *FakePipelineLifecycle) RemoveBuildEventsForDeletedPipelinesReturns(result1 error) { 117 fake.removeBuildEventsForDeletedPipelinesMutex.Lock() 118 defer fake.removeBuildEventsForDeletedPipelinesMutex.Unlock() 119 fake.RemoveBuildEventsForDeletedPipelinesStub = nil 120 fake.removeBuildEventsForDeletedPipelinesReturns = struct { 121 result1 error 122 }{result1} 123} 124 125func (fake *FakePipelineLifecycle) RemoveBuildEventsForDeletedPipelinesReturnsOnCall(i int, result1 error) { 126 fake.removeBuildEventsForDeletedPipelinesMutex.Lock() 127 defer fake.removeBuildEventsForDeletedPipelinesMutex.Unlock() 128 fake.RemoveBuildEventsForDeletedPipelinesStub = nil 129 if fake.removeBuildEventsForDeletedPipelinesReturnsOnCall == nil { 130 fake.removeBuildEventsForDeletedPipelinesReturnsOnCall = make(map[int]struct { 131 result1 error 132 }) 133 } 134 fake.removeBuildEventsForDeletedPipelinesReturnsOnCall[i] = struct { 135 result1 error 136 }{result1} 137} 138 139func (fake *FakePipelineLifecycle) Invocations() map[string][][]interface{} { 140 fake.invocationsMutex.RLock() 141 defer fake.invocationsMutex.RUnlock() 142 fake.archiveAbandonedPipelinesMutex.RLock() 143 defer fake.archiveAbandonedPipelinesMutex.RUnlock() 144 fake.removeBuildEventsForDeletedPipelinesMutex.RLock() 145 defer fake.removeBuildEventsForDeletedPipelinesMutex.RUnlock() 146 copiedInvocations := map[string][][]interface{}{} 147 for key, value := range fake.invocations { 148 copiedInvocations[key] = value 149 } 150 return copiedInvocations 151} 152 153func (fake *FakePipelineLifecycle) recordInvocation(key string, args []interface{}) { 154 fake.invocationsMutex.Lock() 155 defer fake.invocationsMutex.Unlock() 156 if fake.invocations == nil { 157 fake.invocations = map[string][][]interface{}{} 158 } 159 if fake.invocations[key] == nil { 160 fake.invocations[key] = [][]interface{}{} 161 } 162 fake.invocations[key] = append(fake.invocations[key], args) 163} 164 165var _ db.PipelineLifecycle = new(FakePipelineLifecycle) 166