forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_space_quota_repository.go
388 lines (348 loc) · 11.7 KB
/
fake_space_quota_repository.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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
// This file was generated by counterfeiter
package spacequotasfakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/api/spacequotas"
"github.com/cloudfoundry/cli/cf/models"
)
type FakeSpaceQuotaRepository struct {
FindByNameStub func(name string) (quota models.SpaceQuota, apiErr error)
findByNameMutex sync.RWMutex
findByNameArgsForCall []struct {
name string
}
findByNameReturns struct {
result1 models.SpaceQuota
result2 error
}
FindByOrgStub func(guid string) (quota []models.SpaceQuota, apiErr error)
findByOrgMutex sync.RWMutex
findByOrgArgsForCall []struct {
guid string
}
findByOrgReturns struct {
result1 []models.SpaceQuota
result2 error
}
FindByGUIDStub func(guid string) (quota models.SpaceQuota, apiErr error)
findByGUIDMutex sync.RWMutex
findByGUIDArgsForCall []struct {
guid string
}
findByGUIDReturns struct {
result1 models.SpaceQuota
result2 error
}
FindByNameAndOrgGUIDStub func(spaceQuotaName string, orgGUID string) (quota models.SpaceQuota, apiErr error)
findByNameAndOrgGUIDMutex sync.RWMutex
findByNameAndOrgGUIDArgsForCall []struct {
spaceQuotaName string
orgGUID string
}
findByNameAndOrgGUIDReturns struct {
result1 models.SpaceQuota
result2 error
}
AssociateSpaceWithQuotaStub func(spaceGUID string, quotaGUID string) error
associateSpaceWithQuotaMutex sync.RWMutex
associateSpaceWithQuotaArgsForCall []struct {
spaceGUID string
quotaGUID string
}
associateSpaceWithQuotaReturns struct {
result1 error
}
UnassignQuotaFromSpaceStub func(spaceGUID string, quotaGUID string) error
unassignQuotaFromSpaceMutex sync.RWMutex
unassignQuotaFromSpaceArgsForCall []struct {
spaceGUID string
quotaGUID string
}
unassignQuotaFromSpaceReturns struct {
result1 error
}
CreateStub func(quota models.SpaceQuota) error
createMutex sync.RWMutex
createArgsForCall []struct {
quota models.SpaceQuota
}
createReturns struct {
result1 error
}
UpdateStub func(quota models.SpaceQuota) error
updateMutex sync.RWMutex
updateArgsForCall []struct {
quota models.SpaceQuota
}
updateReturns struct {
result1 error
}
DeleteStub func(quotaGUID string) error
deleteMutex sync.RWMutex
deleteArgsForCall []struct {
quotaGUID string
}
deleteReturns struct {
result1 error
}
}
func (fake *FakeSpaceQuotaRepository) FindByName(name string) (quota models.SpaceQuota, apiErr error) {
fake.findByNameMutex.Lock()
fake.findByNameArgsForCall = append(fake.findByNameArgsForCall, struct {
name string
}{name})
fake.findByNameMutex.Unlock()
if fake.FindByNameStub != nil {
return fake.FindByNameStub(name)
} else {
return fake.findByNameReturns.result1, fake.findByNameReturns.result2
}
}
func (fake *FakeSpaceQuotaRepository) FindByNameCallCount() int {
fake.findByNameMutex.RLock()
defer fake.findByNameMutex.RUnlock()
return len(fake.findByNameArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) FindByNameArgsForCall(i int) string {
fake.findByNameMutex.RLock()
defer fake.findByNameMutex.RUnlock()
return fake.findByNameArgsForCall[i].name
}
func (fake *FakeSpaceQuotaRepository) FindByNameReturns(result1 models.SpaceQuota, result2 error) {
fake.FindByNameStub = nil
fake.findByNameReturns = struct {
result1 models.SpaceQuota
result2 error
}{result1, result2}
}
func (fake *FakeSpaceQuotaRepository) FindByOrg(guid string) (quota []models.SpaceQuota, apiErr error) {
fake.findByOrgMutex.Lock()
fake.findByOrgArgsForCall = append(fake.findByOrgArgsForCall, struct {
guid string
}{guid})
fake.findByOrgMutex.Unlock()
if fake.FindByOrgStub != nil {
return fake.FindByOrgStub(guid)
} else {
return fake.findByOrgReturns.result1, fake.findByOrgReturns.result2
}
}
func (fake *FakeSpaceQuotaRepository) FindByOrgCallCount() int {
fake.findByOrgMutex.RLock()
defer fake.findByOrgMutex.RUnlock()
return len(fake.findByOrgArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) FindByOrgArgsForCall(i int) string {
fake.findByOrgMutex.RLock()
defer fake.findByOrgMutex.RUnlock()
return fake.findByOrgArgsForCall[i].guid
}
func (fake *FakeSpaceQuotaRepository) FindByOrgReturns(result1 []models.SpaceQuota, result2 error) {
fake.FindByOrgStub = nil
fake.findByOrgReturns = struct {
result1 []models.SpaceQuota
result2 error
}{result1, result2}
}
func (fake *FakeSpaceQuotaRepository) FindByGUID(guid string) (quota models.SpaceQuota, apiErr error) {
fake.findByGUIDMutex.Lock()
fake.findByGUIDArgsForCall = append(fake.findByGUIDArgsForCall, struct {
guid string
}{guid})
fake.findByGUIDMutex.Unlock()
if fake.FindByGUIDStub != nil {
return fake.FindByGUIDStub(guid)
} else {
return fake.findByGUIDReturns.result1, fake.findByGUIDReturns.result2
}
}
func (fake *FakeSpaceQuotaRepository) FindByGUIDCallCount() int {
fake.findByGUIDMutex.RLock()
defer fake.findByGUIDMutex.RUnlock()
return len(fake.findByGUIDArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) FindByGUIDArgsForCall(i int) string {
fake.findByGUIDMutex.RLock()
defer fake.findByGUIDMutex.RUnlock()
return fake.findByGUIDArgsForCall[i].guid
}
func (fake *FakeSpaceQuotaRepository) FindByGUIDReturns(result1 models.SpaceQuota, result2 error) {
fake.FindByGUIDStub = nil
fake.findByGUIDReturns = struct {
result1 models.SpaceQuota
result2 error
}{result1, result2}
}
func (fake *FakeSpaceQuotaRepository) FindByNameAndOrgGUID(spaceQuotaName string, orgGUID string) (quota models.SpaceQuota, apiErr error) {
fake.findByNameAndOrgGUIDMutex.Lock()
fake.findByNameAndOrgGUIDArgsForCall = append(fake.findByNameAndOrgGUIDArgsForCall, struct {
spaceQuotaName string
orgGUID string
}{spaceQuotaName, orgGUID})
fake.findByNameAndOrgGUIDMutex.Unlock()
if fake.FindByNameAndOrgGUIDStub != nil {
return fake.FindByNameAndOrgGUIDStub(spaceQuotaName, orgGUID)
} else {
return fake.findByNameAndOrgGUIDReturns.result1, fake.findByNameAndOrgGUIDReturns.result2
}
}
func (fake *FakeSpaceQuotaRepository) FindByNameAndOrgGUIDCallCount() int {
fake.findByNameAndOrgGUIDMutex.RLock()
defer fake.findByNameAndOrgGUIDMutex.RUnlock()
return len(fake.findByNameAndOrgGUIDArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) FindByNameAndOrgGUIDArgsForCall(i int) (string, string) {
fake.findByNameAndOrgGUIDMutex.RLock()
defer fake.findByNameAndOrgGUIDMutex.RUnlock()
return fake.findByNameAndOrgGUIDArgsForCall[i].spaceQuotaName, fake.findByNameAndOrgGUIDArgsForCall[i].orgGUID
}
func (fake *FakeSpaceQuotaRepository) FindByNameAndOrgGUIDReturns(result1 models.SpaceQuota, result2 error) {
fake.FindByNameAndOrgGUIDStub = nil
fake.findByNameAndOrgGUIDReturns = struct {
result1 models.SpaceQuota
result2 error
}{result1, result2}
}
func (fake *FakeSpaceQuotaRepository) AssociateSpaceWithQuota(spaceGUID string, quotaGUID string) error {
fake.associateSpaceWithQuotaMutex.Lock()
fake.associateSpaceWithQuotaArgsForCall = append(fake.associateSpaceWithQuotaArgsForCall, struct {
spaceGUID string
quotaGUID string
}{spaceGUID, quotaGUID})
fake.associateSpaceWithQuotaMutex.Unlock()
if fake.AssociateSpaceWithQuotaStub != nil {
return fake.AssociateSpaceWithQuotaStub(spaceGUID, quotaGUID)
} else {
return fake.associateSpaceWithQuotaReturns.result1
}
}
func (fake *FakeSpaceQuotaRepository) AssociateSpaceWithQuotaCallCount() int {
fake.associateSpaceWithQuotaMutex.RLock()
defer fake.associateSpaceWithQuotaMutex.RUnlock()
return len(fake.associateSpaceWithQuotaArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) AssociateSpaceWithQuotaArgsForCall(i int) (string, string) {
fake.associateSpaceWithQuotaMutex.RLock()
defer fake.associateSpaceWithQuotaMutex.RUnlock()
return fake.associateSpaceWithQuotaArgsForCall[i].spaceGUID, fake.associateSpaceWithQuotaArgsForCall[i].quotaGUID
}
func (fake *FakeSpaceQuotaRepository) AssociateSpaceWithQuotaReturns(result1 error) {
fake.AssociateSpaceWithQuotaStub = nil
fake.associateSpaceWithQuotaReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSpaceQuotaRepository) UnassignQuotaFromSpace(spaceGUID string, quotaGUID string) error {
fake.unassignQuotaFromSpaceMutex.Lock()
fake.unassignQuotaFromSpaceArgsForCall = append(fake.unassignQuotaFromSpaceArgsForCall, struct {
spaceGUID string
quotaGUID string
}{spaceGUID, quotaGUID})
fake.unassignQuotaFromSpaceMutex.Unlock()
if fake.UnassignQuotaFromSpaceStub != nil {
return fake.UnassignQuotaFromSpaceStub(spaceGUID, quotaGUID)
} else {
return fake.unassignQuotaFromSpaceReturns.result1
}
}
func (fake *FakeSpaceQuotaRepository) UnassignQuotaFromSpaceCallCount() int {
fake.unassignQuotaFromSpaceMutex.RLock()
defer fake.unassignQuotaFromSpaceMutex.RUnlock()
return len(fake.unassignQuotaFromSpaceArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) UnassignQuotaFromSpaceArgsForCall(i int) (string, string) {
fake.unassignQuotaFromSpaceMutex.RLock()
defer fake.unassignQuotaFromSpaceMutex.RUnlock()
return fake.unassignQuotaFromSpaceArgsForCall[i].spaceGUID, fake.unassignQuotaFromSpaceArgsForCall[i].quotaGUID
}
func (fake *FakeSpaceQuotaRepository) UnassignQuotaFromSpaceReturns(result1 error) {
fake.UnassignQuotaFromSpaceStub = nil
fake.unassignQuotaFromSpaceReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSpaceQuotaRepository) Create(quota models.SpaceQuota) error {
fake.createMutex.Lock()
fake.createArgsForCall = append(fake.createArgsForCall, struct {
quota models.SpaceQuota
}{quota})
fake.createMutex.Unlock()
if fake.CreateStub != nil {
return fake.CreateStub(quota)
} else {
return fake.createReturns.result1
}
}
func (fake *FakeSpaceQuotaRepository) CreateCallCount() int {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return len(fake.createArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) CreateArgsForCall(i int) models.SpaceQuota {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return fake.createArgsForCall[i].quota
}
func (fake *FakeSpaceQuotaRepository) CreateReturns(result1 error) {
fake.CreateStub = nil
fake.createReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSpaceQuotaRepository) Update(quota models.SpaceQuota) error {
fake.updateMutex.Lock()
fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
quota models.SpaceQuota
}{quota})
fake.updateMutex.Unlock()
if fake.UpdateStub != nil {
return fake.UpdateStub(quota)
} else {
return fake.updateReturns.result1
}
}
func (fake *FakeSpaceQuotaRepository) UpdateCallCount() int {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return len(fake.updateArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) UpdateArgsForCall(i int) models.SpaceQuota {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return fake.updateArgsForCall[i].quota
}
func (fake *FakeSpaceQuotaRepository) UpdateReturns(result1 error) {
fake.UpdateStub = nil
fake.updateReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSpaceQuotaRepository) Delete(quotaGUID string) error {
fake.deleteMutex.Lock()
fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
quotaGUID string
}{quotaGUID})
fake.deleteMutex.Unlock()
if fake.DeleteStub != nil {
return fake.DeleteStub(quotaGUID)
} else {
return fake.deleteReturns.result1
}
}
func (fake *FakeSpaceQuotaRepository) DeleteCallCount() int {
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return len(fake.deleteArgsForCall)
}
func (fake *FakeSpaceQuotaRepository) DeleteArgsForCall(i int) string {
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return fake.deleteArgsForCall[i].quotaGUID
}
func (fake *FakeSpaceQuotaRepository) DeleteReturns(result1 error) {
fake.DeleteStub = nil
fake.deleteReturns = struct {
result1 error
}{result1}
}
var _ spacequotas.SpaceQuotaRepository = new(FakeSpaceQuotaRepository)