github.com/chenbh/concourse/v6@v6.4.2/atc/runtime/runtimefakes/fake_starting_event_delegate.go (about) 1 // Code generated by counterfeiter. DO NOT EDIT. 2 package runtimefakes 3 4 import ( 5 "sync" 6 7 "code.cloudfoundry.org/lager" 8 "github.com/chenbh/concourse/v6/atc/runtime" 9 ) 10 11 type FakeStartingEventDelegate struct { 12 SelectedWorkerStub func(lager.Logger, string) 13 selectedWorkerMutex sync.RWMutex 14 selectedWorkerArgsForCall []struct { 15 arg1 lager.Logger 16 arg2 string 17 } 18 StartingStub func(lager.Logger) 19 startingMutex sync.RWMutex 20 startingArgsForCall []struct { 21 arg1 lager.Logger 22 } 23 invocations map[string][][]interface{} 24 invocationsMutex sync.RWMutex 25 } 26 27 func (fake *FakeStartingEventDelegate) SelectedWorker(arg1 lager.Logger, arg2 string) { 28 fake.selectedWorkerMutex.Lock() 29 fake.selectedWorkerArgsForCall = append(fake.selectedWorkerArgsForCall, struct { 30 arg1 lager.Logger 31 arg2 string 32 }{arg1, arg2}) 33 fake.recordInvocation("SelectedWorker", []interface{}{arg1, arg2}) 34 fake.selectedWorkerMutex.Unlock() 35 if fake.SelectedWorkerStub != nil { 36 fake.SelectedWorkerStub(arg1, arg2) 37 } 38 } 39 40 func (fake *FakeStartingEventDelegate) SelectedWorkerCallCount() int { 41 fake.selectedWorkerMutex.RLock() 42 defer fake.selectedWorkerMutex.RUnlock() 43 return len(fake.selectedWorkerArgsForCall) 44 } 45 46 func (fake *FakeStartingEventDelegate) SelectedWorkerCalls(stub func(lager.Logger, string)) { 47 fake.selectedWorkerMutex.Lock() 48 defer fake.selectedWorkerMutex.Unlock() 49 fake.SelectedWorkerStub = stub 50 } 51 52 func (fake *FakeStartingEventDelegate) SelectedWorkerArgsForCall(i int) (lager.Logger, string) { 53 fake.selectedWorkerMutex.RLock() 54 defer fake.selectedWorkerMutex.RUnlock() 55 argsForCall := fake.selectedWorkerArgsForCall[i] 56 return argsForCall.arg1, argsForCall.arg2 57 } 58 59 func (fake *FakeStartingEventDelegate) Starting(arg1 lager.Logger) { 60 fake.startingMutex.Lock() 61 fake.startingArgsForCall = append(fake.startingArgsForCall, struct { 62 arg1 lager.Logger 63 }{arg1}) 64 fake.recordInvocation("Starting", []interface{}{arg1}) 65 fake.startingMutex.Unlock() 66 if fake.StartingStub != nil { 67 fake.StartingStub(arg1) 68 } 69 } 70 71 func (fake *FakeStartingEventDelegate) StartingCallCount() int { 72 fake.startingMutex.RLock() 73 defer fake.startingMutex.RUnlock() 74 return len(fake.startingArgsForCall) 75 } 76 77 func (fake *FakeStartingEventDelegate) StartingCalls(stub func(lager.Logger)) { 78 fake.startingMutex.Lock() 79 defer fake.startingMutex.Unlock() 80 fake.StartingStub = stub 81 } 82 83 func (fake *FakeStartingEventDelegate) StartingArgsForCall(i int) lager.Logger { 84 fake.startingMutex.RLock() 85 defer fake.startingMutex.RUnlock() 86 argsForCall := fake.startingArgsForCall[i] 87 return argsForCall.arg1 88 } 89 90 func (fake *FakeStartingEventDelegate) Invocations() map[string][][]interface{} { 91 fake.invocationsMutex.RLock() 92 defer fake.invocationsMutex.RUnlock() 93 fake.selectedWorkerMutex.RLock() 94 defer fake.selectedWorkerMutex.RUnlock() 95 fake.startingMutex.RLock() 96 defer fake.startingMutex.RUnlock() 97 copiedInvocations := map[string][][]interface{}{} 98 for key, value := range fake.invocations { 99 copiedInvocations[key] = value 100 } 101 return copiedInvocations 102 } 103 104 func (fake *FakeStartingEventDelegate) recordInvocation(key string, args []interface{}) { 105 fake.invocationsMutex.Lock() 106 defer fake.invocationsMutex.Unlock() 107 if fake.invocations == nil { 108 fake.invocations = map[string][][]interface{}{} 109 } 110 if fake.invocations[key] == nil { 111 fake.invocations[key] = [][]interface{}{} 112 } 113 fake.invocations[key] = append(fake.invocations[key], args) 114 } 115 116 var _ runtime.StartingEventDelegate = new(FakeStartingEventDelegate)