github.com/chenbh/concourse/v6@v6.4.2/atc/runtime/runtimefakes/fake_artifact.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package runtimefakes 3 4 import ( 5 "sync" 6 7 "github.com/chenbh/concourse/v6/atc/runtime" 8 ) 9 10 type FakeArtifact struct { 11 IDStub func() string 12 iDMutex sync.RWMutex 13 iDArgsForCall []struct { 14 } 15 iDReturns struct { 16 result1 string 17 } 18 iDReturnsOnCall map[int]struct { 19 result1 string 20 } 21 invocations map[string][][]interface{} 22 invocationsMutex sync.RWMutex 23 } 24 25 func (fake *FakeArtifact) ID() string { 26 fake.iDMutex.Lock() 27 ret, specificReturn := fake.iDReturnsOnCall[len(fake.iDArgsForCall)] 28 fake.iDArgsForCall = append(fake.iDArgsForCall, struct { 29 }{}) 30 fake.recordInvocation("ID", []interface{}{}) 31 fake.iDMutex.Unlock() 32 if fake.IDStub != nil { 33 return fake.IDStub() 34 } 35 if specificReturn { 36 return ret.result1 37 } 38 fakeReturns := fake.iDReturns 39 return fakeReturns.result1 40 } 41 42 func (fake *FakeArtifact) IDCallCount() int { 43 fake.iDMutex.RLock() 44 defer fake.iDMutex.RUnlock() 45 return len(fake.iDArgsForCall) 46 } 47 48 func (fake *FakeArtifact) IDCalls(stub func() string) { 49 fake.iDMutex.Lock() 50 defer fake.iDMutex.Unlock() 51 fake.IDStub = stub 52 } 53 54 func (fake *FakeArtifact) IDReturns(result1 string) { 55 fake.iDMutex.Lock() 56 defer fake.iDMutex.Unlock() 57 fake.IDStub = nil 58 fake.iDReturns = struct { 59 result1 string 60 }{result1} 61 } 62 63 func (fake *FakeArtifact) IDReturnsOnCall(i int, result1 string) { 64 fake.iDMutex.Lock() 65 defer fake.iDMutex.Unlock() 66 fake.IDStub = nil 67 if fake.iDReturnsOnCall == nil { 68 fake.iDReturnsOnCall = make(map[int]struct { 69 result1 string 70 }) 71 } 72 fake.iDReturnsOnCall[i] = struct { 73 result1 string 74 }{result1} 75 } 76 77 func (fake *FakeArtifact) Invocations() map[string][][]interface{} { 78 fake.invocationsMutex.RLock() 79 defer fake.invocationsMutex.RUnlock() 80 fake.iDMutex.RLock() 81 defer fake.iDMutex.RUnlock() 82 copiedInvocations := map[string][][]interface{}{} 83 for key, value := range fake.invocations { 84 copiedInvocations[key] = value 85 } 86 return copiedInvocations 87 } 88 89 func (fake *FakeArtifact) 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 101 var _ runtime.Artifact = new(FakeArtifact)