-
Notifications
You must be signed in to change notification settings - Fork 929
/
fake_security_groups_repo.go
253 lines (230 loc) · 7.57 KB
/
fake_security_groups_repo.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
// Code generated by counterfeiter. DO NOT EDIT.
package runningfakes
import (
"sync"
"code.cloudfoundry.org/cli/cf/api/securitygroups/defaults/running"
"code.cloudfoundry.org/cli/cf/models"
)
type FakeSecurityGroupsRepo struct {
BindToRunningSetStub func(string) error
bindToRunningSetMutex sync.RWMutex
bindToRunningSetArgsForCall []struct {
arg1 string
}
bindToRunningSetReturns struct {
result1 error
}
bindToRunningSetReturnsOnCall map[int]struct {
result1 error
}
ListStub func() ([]models.SecurityGroupFields, error)
listMutex sync.RWMutex
listArgsForCall []struct {
}
listReturns struct {
result1 []models.SecurityGroupFields
result2 error
}
listReturnsOnCall map[int]struct {
result1 []models.SecurityGroupFields
result2 error
}
UnbindFromRunningSetStub func(string) error
unbindFromRunningSetMutex sync.RWMutex
unbindFromRunningSetArgsForCall []struct {
arg1 string
}
unbindFromRunningSetReturns struct {
result1 error
}
unbindFromRunningSetReturnsOnCall map[int]struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeSecurityGroupsRepo) BindToRunningSet(arg1 string) error {
fake.bindToRunningSetMutex.Lock()
ret, specificReturn := fake.bindToRunningSetReturnsOnCall[len(fake.bindToRunningSetArgsForCall)]
fake.bindToRunningSetArgsForCall = append(fake.bindToRunningSetArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("BindToRunningSet", []interface{}{arg1})
fake.bindToRunningSetMutex.Unlock()
if fake.BindToRunningSetStub != nil {
return fake.BindToRunningSetStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.bindToRunningSetReturns
return fakeReturns.result1
}
func (fake *FakeSecurityGroupsRepo) BindToRunningSetCallCount() int {
fake.bindToRunningSetMutex.RLock()
defer fake.bindToRunningSetMutex.RUnlock()
return len(fake.bindToRunningSetArgsForCall)
}
func (fake *FakeSecurityGroupsRepo) BindToRunningSetCalls(stub func(string) error) {
fake.bindToRunningSetMutex.Lock()
defer fake.bindToRunningSetMutex.Unlock()
fake.BindToRunningSetStub = stub
}
func (fake *FakeSecurityGroupsRepo) BindToRunningSetArgsForCall(i int) string {
fake.bindToRunningSetMutex.RLock()
defer fake.bindToRunningSetMutex.RUnlock()
argsForCall := fake.bindToRunningSetArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeSecurityGroupsRepo) BindToRunningSetReturns(result1 error) {
fake.bindToRunningSetMutex.Lock()
defer fake.bindToRunningSetMutex.Unlock()
fake.BindToRunningSetStub = nil
fake.bindToRunningSetReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecurityGroupsRepo) BindToRunningSetReturnsOnCall(i int, result1 error) {
fake.bindToRunningSetMutex.Lock()
defer fake.bindToRunningSetMutex.Unlock()
fake.BindToRunningSetStub = nil
if fake.bindToRunningSetReturnsOnCall == nil {
fake.bindToRunningSetReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.bindToRunningSetReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeSecurityGroupsRepo) List() ([]models.SecurityGroupFields, error) {
fake.listMutex.Lock()
ret, specificReturn := fake.listReturnsOnCall[len(fake.listArgsForCall)]
fake.listArgsForCall = append(fake.listArgsForCall, struct {
}{})
fake.recordInvocation("List", []interface{}{})
fake.listMutex.Unlock()
if fake.ListStub != nil {
return fake.ListStub()
}
if specificReturn {
return ret.result1, ret.result2
}
fakeReturns := fake.listReturns
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeSecurityGroupsRepo) ListCallCount() int {
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
return len(fake.listArgsForCall)
}
func (fake *FakeSecurityGroupsRepo) ListCalls(stub func() ([]models.SecurityGroupFields, error)) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.ListStub = stub
}
func (fake *FakeSecurityGroupsRepo) ListReturns(result1 []models.SecurityGroupFields, result2 error) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.ListStub = nil
fake.listReturns = struct {
result1 []models.SecurityGroupFields
result2 error
}{result1, result2}
}
func (fake *FakeSecurityGroupsRepo) ListReturnsOnCall(i int, result1 []models.SecurityGroupFields, result2 error) {
fake.listMutex.Lock()
defer fake.listMutex.Unlock()
fake.ListStub = nil
if fake.listReturnsOnCall == nil {
fake.listReturnsOnCall = make(map[int]struct {
result1 []models.SecurityGroupFields
result2 error
})
}
fake.listReturnsOnCall[i] = struct {
result1 []models.SecurityGroupFields
result2 error
}{result1, result2}
}
func (fake *FakeSecurityGroupsRepo) UnbindFromRunningSet(arg1 string) error {
fake.unbindFromRunningSetMutex.Lock()
ret, specificReturn := fake.unbindFromRunningSetReturnsOnCall[len(fake.unbindFromRunningSetArgsForCall)]
fake.unbindFromRunningSetArgsForCall = append(fake.unbindFromRunningSetArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("UnbindFromRunningSet", []interface{}{arg1})
fake.unbindFromRunningSetMutex.Unlock()
if fake.UnbindFromRunningSetStub != nil {
return fake.UnbindFromRunningSetStub(arg1)
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.unbindFromRunningSetReturns
return fakeReturns.result1
}
func (fake *FakeSecurityGroupsRepo) UnbindFromRunningSetCallCount() int {
fake.unbindFromRunningSetMutex.RLock()
defer fake.unbindFromRunningSetMutex.RUnlock()
return len(fake.unbindFromRunningSetArgsForCall)
}
func (fake *FakeSecurityGroupsRepo) UnbindFromRunningSetCalls(stub func(string) error) {
fake.unbindFromRunningSetMutex.Lock()
defer fake.unbindFromRunningSetMutex.Unlock()
fake.UnbindFromRunningSetStub = stub
}
func (fake *FakeSecurityGroupsRepo) UnbindFromRunningSetArgsForCall(i int) string {
fake.unbindFromRunningSetMutex.RLock()
defer fake.unbindFromRunningSetMutex.RUnlock()
argsForCall := fake.unbindFromRunningSetArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakeSecurityGroupsRepo) UnbindFromRunningSetReturns(result1 error) {
fake.unbindFromRunningSetMutex.Lock()
defer fake.unbindFromRunningSetMutex.Unlock()
fake.UnbindFromRunningSetStub = nil
fake.unbindFromRunningSetReturns = struct {
result1 error
}{result1}
}
func (fake *FakeSecurityGroupsRepo) UnbindFromRunningSetReturnsOnCall(i int, result1 error) {
fake.unbindFromRunningSetMutex.Lock()
defer fake.unbindFromRunningSetMutex.Unlock()
fake.UnbindFromRunningSetStub = nil
if fake.unbindFromRunningSetReturnsOnCall == nil {
fake.unbindFromRunningSetReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.unbindFromRunningSetReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeSecurityGroupsRepo) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.bindToRunningSetMutex.RLock()
defer fake.bindToRunningSetMutex.RUnlock()
fake.listMutex.RLock()
defer fake.listMutex.RUnlock()
fake.unbindFromRunningSetMutex.RLock()
defer fake.unbindFromRunningSetMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeSecurityGroupsRepo) 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 _ running.SecurityGroupsRepo = new(FakeSecurityGroupsRepo)