forked from digitalocean/atc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_container.go
237 lines (215 loc) · 5.94 KB
/
fake_container.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
// This file was generated by counterfeiter
package dbngfakes
import (
"sync"
"github.com/concourse/atc/dbng"
)
type FakeContainer struct {
IDStub func() int
iDMutex sync.RWMutex
iDArgsForCall []struct{}
iDReturns struct {
result1 int
}
iDReturnsOnCall map[int]struct {
result1 int
}
HandleStub func() string
handleMutex sync.RWMutex
handleArgsForCall []struct{}
handleReturns struct {
result1 string
}
handleReturnsOnCall map[int]struct {
result1 string
}
WorkerNameStub func() string
workerNameMutex sync.RWMutex
workerNameArgsForCall []struct{}
workerNameReturns struct {
result1 string
}
workerNameReturnsOnCall map[int]struct {
result1 string
}
MetadataStub func() dbng.ContainerMetadata
metadataMutex sync.RWMutex
metadataArgsForCall []struct{}
metadataReturns struct {
result1 dbng.ContainerMetadata
}
metadataReturnsOnCall map[int]struct {
result1 dbng.ContainerMetadata
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeContainer) ID() int {
fake.iDMutex.Lock()
ret, specificReturn := fake.iDReturnsOnCall[len(fake.iDArgsForCall)]
fake.iDArgsForCall = append(fake.iDArgsForCall, struct{}{})
fake.recordInvocation("ID", []interface{}{})
fake.iDMutex.Unlock()
if fake.IDStub != nil {
return fake.IDStub()
}
if specificReturn {
return ret.result1
}
return fake.iDReturns.result1
}
func (fake *FakeContainer) IDCallCount() int {
fake.iDMutex.RLock()
defer fake.iDMutex.RUnlock()
return len(fake.iDArgsForCall)
}
func (fake *FakeContainer) IDReturns(result1 int) {
fake.IDStub = nil
fake.iDReturns = struct {
result1 int
}{result1}
}
func (fake *FakeContainer) IDReturnsOnCall(i int, result1 int) {
fake.IDStub = nil
if fake.iDReturnsOnCall == nil {
fake.iDReturnsOnCall = make(map[int]struct {
result1 int
})
}
fake.iDReturnsOnCall[i] = struct {
result1 int
}{result1}
}
func (fake *FakeContainer) Handle() string {
fake.handleMutex.Lock()
ret, specificReturn := fake.handleReturnsOnCall[len(fake.handleArgsForCall)]
fake.handleArgsForCall = append(fake.handleArgsForCall, struct{}{})
fake.recordInvocation("Handle", []interface{}{})
fake.handleMutex.Unlock()
if fake.HandleStub != nil {
return fake.HandleStub()
}
if specificReturn {
return ret.result1
}
return fake.handleReturns.result1
}
func (fake *FakeContainer) HandleCallCount() int {
fake.handleMutex.RLock()
defer fake.handleMutex.RUnlock()
return len(fake.handleArgsForCall)
}
func (fake *FakeContainer) HandleReturns(result1 string) {
fake.HandleStub = nil
fake.handleReturns = struct {
result1 string
}{result1}
}
func (fake *FakeContainer) HandleReturnsOnCall(i int, result1 string) {
fake.HandleStub = nil
if fake.handleReturnsOnCall == nil {
fake.handleReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.handleReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeContainer) WorkerName() string {
fake.workerNameMutex.Lock()
ret, specificReturn := fake.workerNameReturnsOnCall[len(fake.workerNameArgsForCall)]
fake.workerNameArgsForCall = append(fake.workerNameArgsForCall, struct{}{})
fake.recordInvocation("WorkerName", []interface{}{})
fake.workerNameMutex.Unlock()
if fake.WorkerNameStub != nil {
return fake.WorkerNameStub()
}
if specificReturn {
return ret.result1
}
return fake.workerNameReturns.result1
}
func (fake *FakeContainer) WorkerNameCallCount() int {
fake.workerNameMutex.RLock()
defer fake.workerNameMutex.RUnlock()
return len(fake.workerNameArgsForCall)
}
func (fake *FakeContainer) WorkerNameReturns(result1 string) {
fake.WorkerNameStub = nil
fake.workerNameReturns = struct {
result1 string
}{result1}
}
func (fake *FakeContainer) WorkerNameReturnsOnCall(i int, result1 string) {
fake.WorkerNameStub = nil
if fake.workerNameReturnsOnCall == nil {
fake.workerNameReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.workerNameReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakeContainer) Metadata() dbng.ContainerMetadata {
fake.metadataMutex.Lock()
ret, specificReturn := fake.metadataReturnsOnCall[len(fake.metadataArgsForCall)]
fake.metadataArgsForCall = append(fake.metadataArgsForCall, struct{}{})
fake.recordInvocation("Metadata", []interface{}{})
fake.metadataMutex.Unlock()
if fake.MetadataStub != nil {
return fake.MetadataStub()
}
if specificReturn {
return ret.result1
}
return fake.metadataReturns.result1
}
func (fake *FakeContainer) MetadataCallCount() int {
fake.metadataMutex.RLock()
defer fake.metadataMutex.RUnlock()
return len(fake.metadataArgsForCall)
}
func (fake *FakeContainer) MetadataReturns(result1 dbng.ContainerMetadata) {
fake.MetadataStub = nil
fake.metadataReturns = struct {
result1 dbng.ContainerMetadata
}{result1}
}
func (fake *FakeContainer) MetadataReturnsOnCall(i int, result1 dbng.ContainerMetadata) {
fake.MetadataStub = nil
if fake.metadataReturnsOnCall == nil {
fake.metadataReturnsOnCall = make(map[int]struct {
result1 dbng.ContainerMetadata
})
}
fake.metadataReturnsOnCall[i] = struct {
result1 dbng.ContainerMetadata
}{result1}
}
func (fake *FakeContainer) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.iDMutex.RLock()
defer fake.iDMutex.RUnlock()
fake.handleMutex.RLock()
defer fake.handleMutex.RUnlock()
fake.workerNameMutex.RLock()
defer fake.workerNameMutex.RUnlock()
fake.metadataMutex.RLock()
defer fake.metadataMutex.RUnlock()
return fake.invocations
}
func (fake *FakeContainer) 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 _ dbng.Container = new(FakeContainer)