forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_uaa.go
196 lines (176 loc) · 6.36 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
// This file was generated by counterfeiter
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
}
PromptsStub func() ([]uaa.Prompt, error)
promptsMutex sync.RWMutex
promptsArgsForCall []struct{}
promptsReturns struct {
result1 []uaa.Prompt
result2 error
}
ClientCredentialsGrantStub func() (uaa.Token, error)
clientCredentialsGrantMutex sync.RWMutex
clientCredentialsGrantArgsForCall []struct{}
clientCredentialsGrantReturns 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
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeUAA) NewStaleAccessToken(refreshValue string) uaa.StaleAccessToken {
fake.newStaleAccessTokenMutex.Lock()
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)
} else {
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) Prompts() ([]uaa.Prompt, error) {
fake.promptsMutex.Lock()
fake.promptsArgsForCall = append(fake.promptsArgsForCall, struct{}{})
fake.recordInvocation("Prompts", []interface{}{})
fake.promptsMutex.Unlock()
if fake.PromptsStub != nil {
return fake.PromptsStub()
} else {
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) ClientCredentialsGrant() (uaa.Token, error) {
fake.clientCredentialsGrantMutex.Lock()
fake.clientCredentialsGrantArgsForCall = append(fake.clientCredentialsGrantArgsForCall, struct{}{})
fake.recordInvocation("ClientCredentialsGrant", []interface{}{})
fake.clientCredentialsGrantMutex.Unlock()
if fake.ClientCredentialsGrantStub != nil {
return fake.ClientCredentialsGrantStub()
} else {
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) 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()
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)
} else {
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) 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)