forked from concourse/concourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_fetch_source_factory.go
133 lines (121 loc) · 5.14 KB
/
fake_fetch_source_factory.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// Code generated by counterfeiter. DO NOT EDIT.
package workerfakes
import (
"sync"
"code.cloudfoundry.org/lager"
"github.com/chenbh/concourse/v6/atc"
"github.com/chenbh/concourse/v6/atc/db"
"github.com/chenbh/concourse/v6/atc/resource"
"github.com/chenbh/concourse/v6/atc/runtime"
"github.com/chenbh/concourse/v6/atc/worker"
)
type FakeFetchSourceFactory struct {
NewFetchSourceStub func(lager.Logger, worker.Worker, db.ContainerOwner, db.UsedResourceCache, resource.Resource, atc.VersionedResourceTypes, worker.ContainerSpec, runtime.ProcessSpec, db.ContainerMetadata, worker.ImageFetchingDelegate) worker.FetchSource
newFetchSourceMutex sync.RWMutex
newFetchSourceArgsForCall []struct {
arg1 lager.Logger
arg2 worker.Worker
arg3 db.ContainerOwner
arg4 db.UsedResourceCache
arg5 resource.Resource
arg6 atc.VersionedResourceTypes
arg7 worker.ContainerSpec
arg8 runtime.ProcessSpec
arg9 db.ContainerMetadata
arg10 worker.ImageFetchingDelegate
}
newFetchSourceReturns struct {
result1 worker.FetchSource
}
newFetchSourceReturnsOnCall map[int]struct {
result1 worker.FetchSource
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeFetchSourceFactory) NewFetchSource(arg1 lager.Logger, arg2 worker.Worker, arg3 db.ContainerOwner, arg4 db.UsedResourceCache, arg5 resource.Resource, arg6 atc.VersionedResourceTypes, arg7 worker.ContainerSpec, arg8 runtime.ProcessSpec, arg9 db.ContainerMetadata, arg10 worker.ImageFetchingDelegate) worker.FetchSource {
fake.newFetchSourceMutex.Lock()
ret, specificReturn := fake.newFetchSourceReturnsOnCall[len(fake.newFetchSourceArgsForCall)]
fake.newFetchSourceArgsForCall = append(fake.newFetchSourceArgsForCall, struct {
arg1 lager.Logger
arg2 worker.Worker
arg3 db.ContainerOwner
arg4 db.UsedResourceCache
arg5 resource.Resource
arg6 atc.VersionedResourceTypes
arg7 worker.ContainerSpec
arg8 runtime.ProcessSpec
arg9 db.ContainerMetadata
arg10 worker.ImageFetchingDelegate
}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10})
fake.recordInvocation("NewFetchSource", []interface{}{arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10})
fake.newFetchSourceMutex.Unlock()
if fake.NewFetchSourceStub != nil {
return fake.NewFetchSourceStub(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.newFetchSourceReturns
return fakeReturns.result1
}
func (fake *FakeFetchSourceFactory) NewFetchSourceCallCount() int {
fake.newFetchSourceMutex.RLock()
defer fake.newFetchSourceMutex.RUnlock()
return len(fake.newFetchSourceArgsForCall)
}
func (fake *FakeFetchSourceFactory) NewFetchSourceCalls(stub func(lager.Logger, worker.Worker, db.ContainerOwner, db.UsedResourceCache, resource.Resource, atc.VersionedResourceTypes, worker.ContainerSpec, runtime.ProcessSpec, db.ContainerMetadata, worker.ImageFetchingDelegate) worker.FetchSource) {
fake.newFetchSourceMutex.Lock()
defer fake.newFetchSourceMutex.Unlock()
fake.NewFetchSourceStub = stub
}
func (fake *FakeFetchSourceFactory) NewFetchSourceArgsForCall(i int) (lager.Logger, worker.Worker, db.ContainerOwner, db.UsedResourceCache, resource.Resource, atc.VersionedResourceTypes, worker.ContainerSpec, runtime.ProcessSpec, db.ContainerMetadata, worker.ImageFetchingDelegate) {
fake.newFetchSourceMutex.RLock()
defer fake.newFetchSourceMutex.RUnlock()
argsForCall := fake.newFetchSourceArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3, argsForCall.arg4, argsForCall.arg5, argsForCall.arg6, argsForCall.arg7, argsForCall.arg8, argsForCall.arg9, argsForCall.arg10
}
func (fake *FakeFetchSourceFactory) NewFetchSourceReturns(result1 worker.FetchSource) {
fake.newFetchSourceMutex.Lock()
defer fake.newFetchSourceMutex.Unlock()
fake.NewFetchSourceStub = nil
fake.newFetchSourceReturns = struct {
result1 worker.FetchSource
}{result1}
}
func (fake *FakeFetchSourceFactory) NewFetchSourceReturnsOnCall(i int, result1 worker.FetchSource) {
fake.newFetchSourceMutex.Lock()
defer fake.newFetchSourceMutex.Unlock()
fake.NewFetchSourceStub = nil
if fake.newFetchSourceReturnsOnCall == nil {
fake.newFetchSourceReturnsOnCall = make(map[int]struct {
result1 worker.FetchSource
})
}
fake.newFetchSourceReturnsOnCall[i] = struct {
result1 worker.FetchSource
}{result1}
}
func (fake *FakeFetchSourceFactory) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.newFetchSourceMutex.RLock()
defer fake.newFetchSourceMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeFetchSourceFactory) recordInvocation(key string, args []interface{}) {
fake.invocationsMutex.Lock()
defer fake.invocationsMutex.Unlock()
if fake.invocations == nil {
fake.invocations = map[string][][]interface{}{}
}
if fake.invocations[key] == nil {
fake.invocations[key] = [][]interface{}{}
}
fake.invocations[key] = append(fake.invocations[key], args)
}
var _ worker.FetchSourceFactory = new(FakeFetchSourceFactory)