forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_plugin_configuration.go
307 lines (278 loc) · 9 KB
/
fake_plugin_configuration.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
// Code generated by counterfeiter. DO NOT EDIT.
package pluginconfigfakes
import (
"sync"
"code.cloudfoundry.org/cli/cf/configuration/pluginconfig"
)
type FakePluginConfiguration struct {
GetPluginPathStub func() string
getPluginPathMutex sync.RWMutex
getPluginPathArgsForCall []struct {
}
getPluginPathReturns struct {
result1 string
}
getPluginPathReturnsOnCall map[int]struct {
result1 string
}
ListCommandsStub func() []string
listCommandsMutex sync.RWMutex
listCommandsArgsForCall []struct {
}
listCommandsReturns struct {
result1 []string
}
listCommandsReturnsOnCall map[int]struct {
result1 []string
}
PluginsStub func() map[string]pluginconfig.PluginMetadata
pluginsMutex sync.RWMutex
pluginsArgsForCall []struct {
}
pluginsReturns struct {
result1 map[string]pluginconfig.PluginMetadata
}
pluginsReturnsOnCall map[int]struct {
result1 map[string]pluginconfig.PluginMetadata
}
RemovePluginStub func(string)
removePluginMutex sync.RWMutex
removePluginArgsForCall []struct {
arg1 string
}
SetPluginStub func(string, pluginconfig.PluginMetadata)
setPluginMutex sync.RWMutex
setPluginArgsForCall []struct {
arg1 string
arg2 pluginconfig.PluginMetadata
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakePluginConfiguration) GetPluginPath() string {
fake.getPluginPathMutex.Lock()
ret, specificReturn := fake.getPluginPathReturnsOnCall[len(fake.getPluginPathArgsForCall)]
fake.getPluginPathArgsForCall = append(fake.getPluginPathArgsForCall, struct {
}{})
fake.recordInvocation("GetPluginPath", []interface{}{})
fake.getPluginPathMutex.Unlock()
if fake.GetPluginPathStub != nil {
return fake.GetPluginPathStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.getPluginPathReturns
return fakeReturns.result1
}
func (fake *FakePluginConfiguration) GetPluginPathCallCount() int {
fake.getPluginPathMutex.RLock()
defer fake.getPluginPathMutex.RUnlock()
return len(fake.getPluginPathArgsForCall)
}
func (fake *FakePluginConfiguration) GetPluginPathCalls(stub func() string) {
fake.getPluginPathMutex.Lock()
defer fake.getPluginPathMutex.Unlock()
fake.GetPluginPathStub = stub
}
func (fake *FakePluginConfiguration) GetPluginPathReturns(result1 string) {
fake.getPluginPathMutex.Lock()
defer fake.getPluginPathMutex.Unlock()
fake.GetPluginPathStub = nil
fake.getPluginPathReturns = struct {
result1 string
}{result1}
}
func (fake *FakePluginConfiguration) GetPluginPathReturnsOnCall(i int, result1 string) {
fake.getPluginPathMutex.Lock()
defer fake.getPluginPathMutex.Unlock()
fake.GetPluginPathStub = nil
if fake.getPluginPathReturnsOnCall == nil {
fake.getPluginPathReturnsOnCall = make(map[int]struct {
result1 string
})
}
fake.getPluginPathReturnsOnCall[i] = struct {
result1 string
}{result1}
}
func (fake *FakePluginConfiguration) ListCommands() []string {
fake.listCommandsMutex.Lock()
ret, specificReturn := fake.listCommandsReturnsOnCall[len(fake.listCommandsArgsForCall)]
fake.listCommandsArgsForCall = append(fake.listCommandsArgsForCall, struct {
}{})
fake.recordInvocation("ListCommands", []interface{}{})
fake.listCommandsMutex.Unlock()
if fake.ListCommandsStub != nil {
return fake.ListCommandsStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.listCommandsReturns
return fakeReturns.result1
}
func (fake *FakePluginConfiguration) ListCommandsCallCount() int {
fake.listCommandsMutex.RLock()
defer fake.listCommandsMutex.RUnlock()
return len(fake.listCommandsArgsForCall)
}
func (fake *FakePluginConfiguration) ListCommandsCalls(stub func() []string) {
fake.listCommandsMutex.Lock()
defer fake.listCommandsMutex.Unlock()
fake.ListCommandsStub = stub
}
func (fake *FakePluginConfiguration) ListCommandsReturns(result1 []string) {
fake.listCommandsMutex.Lock()
defer fake.listCommandsMutex.Unlock()
fake.ListCommandsStub = nil
fake.listCommandsReturns = struct {
result1 []string
}{result1}
}
func (fake *FakePluginConfiguration) ListCommandsReturnsOnCall(i int, result1 []string) {
fake.listCommandsMutex.Lock()
defer fake.listCommandsMutex.Unlock()
fake.ListCommandsStub = nil
if fake.listCommandsReturnsOnCall == nil {
fake.listCommandsReturnsOnCall = make(map[int]struct {
result1 []string
})
}
fake.listCommandsReturnsOnCall[i] = struct {
result1 []string
}{result1}
}
func (fake *FakePluginConfiguration) Plugins() map[string]pluginconfig.PluginMetadata {
fake.pluginsMutex.Lock()
ret, specificReturn := fake.pluginsReturnsOnCall[len(fake.pluginsArgsForCall)]
fake.pluginsArgsForCall = append(fake.pluginsArgsForCall, struct {
}{})
fake.recordInvocation("Plugins", []interface{}{})
fake.pluginsMutex.Unlock()
if fake.PluginsStub != nil {
return fake.PluginsStub()
}
if specificReturn {
return ret.result1
}
fakeReturns := fake.pluginsReturns
return fakeReturns.result1
}
func (fake *FakePluginConfiguration) PluginsCallCount() int {
fake.pluginsMutex.RLock()
defer fake.pluginsMutex.RUnlock()
return len(fake.pluginsArgsForCall)
}
func (fake *FakePluginConfiguration) PluginsCalls(stub func() map[string]pluginconfig.PluginMetadata) {
fake.pluginsMutex.Lock()
defer fake.pluginsMutex.Unlock()
fake.PluginsStub = stub
}
func (fake *FakePluginConfiguration) PluginsReturns(result1 map[string]pluginconfig.PluginMetadata) {
fake.pluginsMutex.Lock()
defer fake.pluginsMutex.Unlock()
fake.PluginsStub = nil
fake.pluginsReturns = struct {
result1 map[string]pluginconfig.PluginMetadata
}{result1}
}
func (fake *FakePluginConfiguration) PluginsReturnsOnCall(i int, result1 map[string]pluginconfig.PluginMetadata) {
fake.pluginsMutex.Lock()
defer fake.pluginsMutex.Unlock()
fake.PluginsStub = nil
if fake.pluginsReturnsOnCall == nil {
fake.pluginsReturnsOnCall = make(map[int]struct {
result1 map[string]pluginconfig.PluginMetadata
})
}
fake.pluginsReturnsOnCall[i] = struct {
result1 map[string]pluginconfig.PluginMetadata
}{result1}
}
func (fake *FakePluginConfiguration) RemovePlugin(arg1 string) {
fake.removePluginMutex.Lock()
fake.removePluginArgsForCall = append(fake.removePluginArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("RemovePlugin", []interface{}{arg1})
fake.removePluginMutex.Unlock()
if fake.RemovePluginStub != nil {
fake.RemovePluginStub(arg1)
}
}
func (fake *FakePluginConfiguration) RemovePluginCallCount() int {
fake.removePluginMutex.RLock()
defer fake.removePluginMutex.RUnlock()
return len(fake.removePluginArgsForCall)
}
func (fake *FakePluginConfiguration) RemovePluginCalls(stub func(string)) {
fake.removePluginMutex.Lock()
defer fake.removePluginMutex.Unlock()
fake.RemovePluginStub = stub
}
func (fake *FakePluginConfiguration) RemovePluginArgsForCall(i int) string {
fake.removePluginMutex.RLock()
defer fake.removePluginMutex.RUnlock()
argsForCall := fake.removePluginArgsForCall[i]
return argsForCall.arg1
}
func (fake *FakePluginConfiguration) SetPlugin(arg1 string, arg2 pluginconfig.PluginMetadata) {
fake.setPluginMutex.Lock()
fake.setPluginArgsForCall = append(fake.setPluginArgsForCall, struct {
arg1 string
arg2 pluginconfig.PluginMetadata
}{arg1, arg2})
fake.recordInvocation("SetPlugin", []interface{}{arg1, arg2})
fake.setPluginMutex.Unlock()
if fake.SetPluginStub != nil {
fake.SetPluginStub(arg1, arg2)
}
}
func (fake *FakePluginConfiguration) SetPluginCallCount() int {
fake.setPluginMutex.RLock()
defer fake.setPluginMutex.RUnlock()
return len(fake.setPluginArgsForCall)
}
func (fake *FakePluginConfiguration) SetPluginCalls(stub func(string, pluginconfig.PluginMetadata)) {
fake.setPluginMutex.Lock()
defer fake.setPluginMutex.Unlock()
fake.SetPluginStub = stub
}
func (fake *FakePluginConfiguration) SetPluginArgsForCall(i int) (string, pluginconfig.PluginMetadata) {
fake.setPluginMutex.RLock()
defer fake.setPluginMutex.RUnlock()
argsForCall := fake.setPluginArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakePluginConfiguration) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getPluginPathMutex.RLock()
defer fake.getPluginPathMutex.RUnlock()
fake.listCommandsMutex.RLock()
defer fake.listCommandsMutex.RUnlock()
fake.pluginsMutex.RLock()
defer fake.pluginsMutex.RUnlock()
fake.removePluginMutex.RLock()
defer fake.removePluginMutex.RUnlock()
fake.setPluginMutex.RLock()
defer fake.setPluginMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakePluginConfiguration) 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 _ pluginconfig.PluginConfiguration = new(FakePluginConfiguration)