forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_stemcell.go
278 lines (249 loc) · 6.83 KB
/
fake_stemcell.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
// This file was generated by counterfeiter
package directorfakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/director"
semver "github.com/cppforlife/go-semi-semantic/version"
)
type FakeStemcell struct {
NameStub func() string
nameMutex sync.RWMutex
nameArgsForCall []struct{}
nameReturns struct {
result1 string
}
VersionStub func() semver.Version
versionMutex sync.RWMutex
versionArgsForCall []struct{}
versionReturns struct {
result1 semver.Version
}
VersionMarkStub func(mark string) string
versionMarkMutex sync.RWMutex
versionMarkArgsForCall []struct {
mark string
}
versionMarkReturns struct {
result1 string
}
OSNameStub func() string
oSNameMutex sync.RWMutex
oSNameArgsForCall []struct{}
oSNameReturns struct {
result1 string
}
CPIStub func() string
cPIMutex sync.RWMutex
cPIArgsForCall []struct{}
cPIReturns struct {
result1 string
}
CIDStub func() string
cIDMutex sync.RWMutex
cIDArgsForCall []struct{}
cIDReturns struct {
result1 string
}
DeleteStub func(force bool) error
deleteMutex sync.RWMutex
deleteArgsForCall []struct {
force bool
}
deleteReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeStemcell) Name() string {
fake.nameMutex.Lock()
fake.nameArgsForCall = append(fake.nameArgsForCall, struct{}{})
fake.recordInvocation("Name", []interface{}{})
fake.nameMutex.Unlock()
if fake.NameStub != nil {
return fake.NameStub()
}
return fake.nameReturns.result1
}
func (fake *FakeStemcell) NameCallCount() int {
fake.nameMutex.RLock()
defer fake.nameMutex.RUnlock()
return len(fake.nameArgsForCall)
}
func (fake *FakeStemcell) NameReturns(result1 string) {
fake.NameStub = nil
fake.nameReturns = struct {
result1 string
}{result1}
}
func (fake *FakeStemcell) Version() semver.Version {
fake.versionMutex.Lock()
fake.versionArgsForCall = append(fake.versionArgsForCall, struct{}{})
fake.recordInvocation("Version", []interface{}{})
fake.versionMutex.Unlock()
if fake.VersionStub != nil {
return fake.VersionStub()
}
return fake.versionReturns.result1
}
func (fake *FakeStemcell) VersionCallCount() int {
fake.versionMutex.RLock()
defer fake.versionMutex.RUnlock()
return len(fake.versionArgsForCall)
}
func (fake *FakeStemcell) VersionReturns(result1 semver.Version) {
fake.VersionStub = nil
fake.versionReturns = struct {
result1 semver.Version
}{result1}
}
func (fake *FakeStemcell) VersionMark(mark string) string {
fake.versionMarkMutex.Lock()
fake.versionMarkArgsForCall = append(fake.versionMarkArgsForCall, struct {
mark string
}{mark})
fake.recordInvocation("VersionMark", []interface{}{mark})
fake.versionMarkMutex.Unlock()
if fake.VersionMarkStub != nil {
return fake.VersionMarkStub(mark)
}
return fake.versionMarkReturns.result1
}
func (fake *FakeStemcell) VersionMarkCallCount() int {
fake.versionMarkMutex.RLock()
defer fake.versionMarkMutex.RUnlock()
return len(fake.versionMarkArgsForCall)
}
func (fake *FakeStemcell) VersionMarkArgsForCall(i int) string {
fake.versionMarkMutex.RLock()
defer fake.versionMarkMutex.RUnlock()
return fake.versionMarkArgsForCall[i].mark
}
func (fake *FakeStemcell) VersionMarkReturns(result1 string) {
fake.VersionMarkStub = nil
fake.versionMarkReturns = struct {
result1 string
}{result1}
}
func (fake *FakeStemcell) OSName() string {
fake.oSNameMutex.Lock()
fake.oSNameArgsForCall = append(fake.oSNameArgsForCall, struct{}{})
fake.recordInvocation("OSName", []interface{}{})
fake.oSNameMutex.Unlock()
if fake.OSNameStub != nil {
return fake.OSNameStub()
}
return fake.oSNameReturns.result1
}
func (fake *FakeStemcell) OSNameCallCount() int {
fake.oSNameMutex.RLock()
defer fake.oSNameMutex.RUnlock()
return len(fake.oSNameArgsForCall)
}
func (fake *FakeStemcell) OSNameReturns(result1 string) {
fake.OSNameStub = nil
fake.oSNameReturns = struct {
result1 string
}{result1}
}
func (fake *FakeStemcell) CPI() string {
fake.cPIMutex.Lock()
fake.cPIArgsForCall = append(fake.cPIArgsForCall, struct{}{})
fake.recordInvocation("CPI", []interface{}{})
fake.cPIMutex.Unlock()
if fake.CPIStub != nil {
return fake.CPIStub()
}
return fake.cPIReturns.result1
}
func (fake *FakeStemcell) CPICallCount() int {
fake.cPIMutex.RLock()
defer fake.cPIMutex.RUnlock()
return len(fake.cPIArgsForCall)
}
func (fake *FakeStemcell) CPIReturns(result1 string) {
fake.CPIStub = nil
fake.cPIReturns = struct {
result1 string
}{result1}
}
func (fake *FakeStemcell) CID() string {
fake.cIDMutex.Lock()
fake.cIDArgsForCall = append(fake.cIDArgsForCall, struct{}{})
fake.recordInvocation("CID", []interface{}{})
fake.cIDMutex.Unlock()
if fake.CIDStub != nil {
return fake.CIDStub()
}
return fake.cIDReturns.result1
}
func (fake *FakeStemcell) CIDCallCount() int {
fake.cIDMutex.RLock()
defer fake.cIDMutex.RUnlock()
return len(fake.cIDArgsForCall)
}
func (fake *FakeStemcell) CIDReturns(result1 string) {
fake.CIDStub = nil
fake.cIDReturns = struct {
result1 string
}{result1}
}
func (fake *FakeStemcell) Delete(force bool) error {
fake.deleteMutex.Lock()
fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
force bool
}{force})
fake.recordInvocation("Delete", []interface{}{force})
fake.deleteMutex.Unlock()
if fake.DeleteStub != nil {
return fake.DeleteStub(force)
}
return fake.deleteReturns.result1
}
func (fake *FakeStemcell) DeleteCallCount() int {
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return len(fake.deleteArgsForCall)
}
func (fake *FakeStemcell) DeleteArgsForCall(i int) bool {
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return fake.deleteArgsForCall[i].force
}
func (fake *FakeStemcell) DeleteReturns(result1 error) {
fake.DeleteStub = nil
fake.deleteReturns = struct {
result1 error
}{result1}
}
func (fake *FakeStemcell) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.nameMutex.RLock()
defer fake.nameMutex.RUnlock()
fake.versionMutex.RLock()
defer fake.versionMutex.RUnlock()
fake.versionMarkMutex.RLock()
defer fake.versionMarkMutex.RUnlock()
fake.oSNameMutex.RLock()
defer fake.oSNameMutex.RUnlock()
fake.cPIMutex.RLock()
defer fake.cPIMutex.RUnlock()
fake.cIDMutex.RLock()
defer fake.cIDMutex.RUnlock()
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return fake.invocations
}
func (fake *FakeStemcell) 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 _ director.Stemcell = new(FakeStemcell)