forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_uaa.go
277 lines (253 loc) · 8.9 KB
/
fake_uaa.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
// Code generated by counterfeiter. DO NOT EDIT.
package uaafakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/uaa"
)
type FakeUAA struct {
NewStaleAccessTokenStub func(refreshValue string) uaa.StaleAccessToken
newStaleAccessTokenMutex sync.RWMutex
newStaleAccessTokenArgsForCall []struct {
refreshValue string
}
newStaleAccessTokenReturns struct {
result1 uaa.StaleAccessToken
}
newStaleAccessTokenReturnsOnCall map[int]struct {
result1 uaa.StaleAccessToken
}
PromptsStub func() ([]uaa.Prompt, error)
promptsMutex sync.RWMutex
promptsArgsForCall []struct{}
promptsReturns struct {
result1 []uaa.Prompt
result2 error
}
promptsReturnsOnCall map[int]struct {
result1 []uaa.Prompt
result2 error
}
ClientCredentialsGrantStub func() (uaa.Token, error)
clientCredentialsGrantMutex sync.RWMutex
clientCredentialsGrantArgsForCall []struct{}
clientCredentialsGrantReturns struct {
result1 uaa.Token
result2 error
}
clientCredentialsGrantReturnsOnCall map[int]struct {
result1 uaa.Token
result2 error
}
OwnerPasswordCredentialsGrantStub func([]uaa.PromptAnswer) (uaa.AccessToken, error)
ownerPasswordCredentialsGrantMutex sync.RWMutex
ownerPasswordCredentialsGrantArgsForCall []struct {
arg1 []uaa.PromptAnswer
}
ownerPasswordCredentialsGrantReturns struct {
result1 uaa.AccessToken
result2 error
}
ownerPasswordCredentialsGrantReturnsOnCall map[int]struct {
result1 uaa.AccessToken
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeUAA) NewStaleAccessToken(refreshValue string) uaa.StaleAccessToken {
fake.newStaleAccessTokenMutex.Lock()
ret, specificReturn := fake.newStaleAccessTokenReturnsOnCall[len(fake.newStaleAccessTokenArgsForCall)]
fake.newStaleAccessTokenArgsForCall = append(fake.newStaleAccessTokenArgsForCall, struct {
refreshValue string
}{refreshValue})
fake.recordInvocation("NewStaleAccessToken", []interface{}{refreshValue})
fake.newStaleAccessTokenMutex.Unlock()
if fake.NewStaleAccessTokenStub != nil {
return fake.NewStaleAccessTokenStub(refreshValue)
}
if specificReturn {
return ret.result1
}
return fake.newStaleAccessTokenReturns.result1
}
func (fake *FakeUAA) NewStaleAccessTokenCallCount() int {
fake.newStaleAccessTokenMutex.RLock()
defer fake.newStaleAccessTokenMutex.RUnlock()
return len(fake.newStaleAccessTokenArgsForCall)
}
func (fake *FakeUAA) NewStaleAccessTokenArgsForCall(i int) string {
fake.newStaleAccessTokenMutex.RLock()
defer fake.newStaleAccessTokenMutex.RUnlock()
return fake.newStaleAccessTokenArgsForCall[i].refreshValue
}
func (fake *FakeUAA) NewStaleAccessTokenReturns(result1 uaa.StaleAccessToken) {
fake.NewStaleAccessTokenStub = nil
fake.newStaleAccessTokenReturns = struct {
result1 uaa.StaleAccessToken
}{result1}
}
func (fake *FakeUAA) NewStaleAccessTokenReturnsOnCall(i int, result1 uaa.StaleAccessToken) {
fake.NewStaleAccessTokenStub = nil
if fake.newStaleAccessTokenReturnsOnCall == nil {
fake.newStaleAccessTokenReturnsOnCall = make(map[int]struct {
result1 uaa.StaleAccessToken
})
}
fake.newStaleAccessTokenReturnsOnCall[i] = struct {
result1 uaa.StaleAccessToken
}{result1}
}
func (fake *FakeUAA) Prompts() ([]uaa.Prompt, error) {
fake.promptsMutex.Lock()
ret, specificReturn := fake.promptsReturnsOnCall[len(fake.promptsArgsForCall)]
fake.promptsArgsForCall = append(fake.promptsArgsForCall, struct{}{})
fake.recordInvocation("Prompts", []interface{}{})
fake.promptsMutex.Unlock()
if fake.PromptsStub != nil {
return fake.PromptsStub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.promptsReturns.result1, fake.promptsReturns.result2
}
func (fake *FakeUAA) PromptsCallCount() int {
fake.promptsMutex.RLock()
defer fake.promptsMutex.RUnlock()
return len(fake.promptsArgsForCall)
}
func (fake *FakeUAA) PromptsReturns(result1 []uaa.Prompt, result2 error) {
fake.PromptsStub = nil
fake.promptsReturns = struct {
result1 []uaa.Prompt
result2 error
}{result1, result2}
}
func (fake *FakeUAA) PromptsReturnsOnCall(i int, result1 []uaa.Prompt, result2 error) {
fake.PromptsStub = nil
if fake.promptsReturnsOnCall == nil {
fake.promptsReturnsOnCall = make(map[int]struct {
result1 []uaa.Prompt
result2 error
})
}
fake.promptsReturnsOnCall[i] = struct {
result1 []uaa.Prompt
result2 error
}{result1, result2}
}
func (fake *FakeUAA) ClientCredentialsGrant() (uaa.Token, error) {
fake.clientCredentialsGrantMutex.Lock()
ret, specificReturn := fake.clientCredentialsGrantReturnsOnCall[len(fake.clientCredentialsGrantArgsForCall)]
fake.clientCredentialsGrantArgsForCall = append(fake.clientCredentialsGrantArgsForCall, struct{}{})
fake.recordInvocation("ClientCredentialsGrant", []interface{}{})
fake.clientCredentialsGrantMutex.Unlock()
if fake.ClientCredentialsGrantStub != nil {
return fake.ClientCredentialsGrantStub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.clientCredentialsGrantReturns.result1, fake.clientCredentialsGrantReturns.result2
}
func (fake *FakeUAA) ClientCredentialsGrantCallCount() int {
fake.clientCredentialsGrantMutex.RLock()
defer fake.clientCredentialsGrantMutex.RUnlock()
return len(fake.clientCredentialsGrantArgsForCall)
}
func (fake *FakeUAA) ClientCredentialsGrantReturns(result1 uaa.Token, result2 error) {
fake.ClientCredentialsGrantStub = nil
fake.clientCredentialsGrantReturns = struct {
result1 uaa.Token
result2 error
}{result1, result2}
}
func (fake *FakeUAA) ClientCredentialsGrantReturnsOnCall(i int, result1 uaa.Token, result2 error) {
fake.ClientCredentialsGrantStub = nil
if fake.clientCredentialsGrantReturnsOnCall == nil {
fake.clientCredentialsGrantReturnsOnCall = make(map[int]struct {
result1 uaa.Token
result2 error
})
}
fake.clientCredentialsGrantReturnsOnCall[i] = struct {
result1 uaa.Token
result2 error
}{result1, result2}
}
func (fake *FakeUAA) OwnerPasswordCredentialsGrant(arg1 []uaa.PromptAnswer) (uaa.AccessToken, error) {
var arg1Copy []uaa.PromptAnswer
if arg1 != nil {
arg1Copy = make([]uaa.PromptAnswer, len(arg1))
copy(arg1Copy, arg1)
}
fake.ownerPasswordCredentialsGrantMutex.Lock()
ret, specificReturn := fake.ownerPasswordCredentialsGrantReturnsOnCall[len(fake.ownerPasswordCredentialsGrantArgsForCall)]
fake.ownerPasswordCredentialsGrantArgsForCall = append(fake.ownerPasswordCredentialsGrantArgsForCall, struct {
arg1 []uaa.PromptAnswer
}{arg1Copy})
fake.recordInvocation("OwnerPasswordCredentialsGrant", []interface{}{arg1Copy})
fake.ownerPasswordCredentialsGrantMutex.Unlock()
if fake.OwnerPasswordCredentialsGrantStub != nil {
return fake.OwnerPasswordCredentialsGrantStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.ownerPasswordCredentialsGrantReturns.result1, fake.ownerPasswordCredentialsGrantReturns.result2
}
func (fake *FakeUAA) OwnerPasswordCredentialsGrantCallCount() int {
fake.ownerPasswordCredentialsGrantMutex.RLock()
defer fake.ownerPasswordCredentialsGrantMutex.RUnlock()
return len(fake.ownerPasswordCredentialsGrantArgsForCall)
}
func (fake *FakeUAA) OwnerPasswordCredentialsGrantArgsForCall(i int) []uaa.PromptAnswer {
fake.ownerPasswordCredentialsGrantMutex.RLock()
defer fake.ownerPasswordCredentialsGrantMutex.RUnlock()
return fake.ownerPasswordCredentialsGrantArgsForCall[i].arg1
}
func (fake *FakeUAA) OwnerPasswordCredentialsGrantReturns(result1 uaa.AccessToken, result2 error) {
fake.OwnerPasswordCredentialsGrantStub = nil
fake.ownerPasswordCredentialsGrantReturns = struct {
result1 uaa.AccessToken
result2 error
}{result1, result2}
}
func (fake *FakeUAA) OwnerPasswordCredentialsGrantReturnsOnCall(i int, result1 uaa.AccessToken, result2 error) {
fake.OwnerPasswordCredentialsGrantStub = nil
if fake.ownerPasswordCredentialsGrantReturnsOnCall == nil {
fake.ownerPasswordCredentialsGrantReturnsOnCall = make(map[int]struct {
result1 uaa.AccessToken
result2 error
})
}
fake.ownerPasswordCredentialsGrantReturnsOnCall[i] = struct {
result1 uaa.AccessToken
result2 error
}{result1, result2}
}
func (fake *FakeUAA) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.newStaleAccessTokenMutex.RLock()
defer fake.newStaleAccessTokenMutex.RUnlock()
fake.promptsMutex.RLock()
defer fake.promptsMutex.RUnlock()
fake.clientCredentialsGrantMutex.RLock()
defer fake.clientCredentialsGrantMutex.RUnlock()
fake.ownerPasswordCredentialsGrantMutex.RLock()
defer fake.ownerPasswordCredentialsGrantMutex.RUnlock()
return fake.invocations
}
func (fake *FakeUAA) 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 _ uaa.UAA = new(FakeUAA)