forked from vmware-archive/atc
/
fake_auth_config.go
203 lines (184 loc) · 5.57 KB
/
fake_auth_config.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
// Code generated by counterfeiter. DO NOT EDIT.
package providerfakes
import (
"sync"
"github.com/concourse/atc"
"github.com/concourse/atc/auth/provider"
)
type FakeAuthConfig struct {
IsConfiguredStub func() bool
isConfiguredMutex sync.RWMutex
isConfiguredArgsForCall []struct{}
isConfiguredReturns struct {
result1 bool
}
isConfiguredReturnsOnCall map[int]struct {
result1 bool
}
ValidateStub func() error
validateMutex sync.RWMutex
validateArgsForCall []struct{}
validateReturns struct {
result1 error
}
validateReturnsOnCall map[int]struct {
result1 error
}
AuthMethodStub func(oauthBaseURL string, teamName string) atc.AuthMethod
authMethodMutex sync.RWMutex
authMethodArgsForCall []struct {
oauthBaseURL string
teamName string
}
authMethodReturns struct {
result1 atc.AuthMethod
}
authMethodReturnsOnCall map[int]struct {
result1 atc.AuthMethod
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeAuthConfig) IsConfigured() bool {
fake.isConfiguredMutex.Lock()
ret, specificReturn := fake.isConfiguredReturnsOnCall[len(fake.isConfiguredArgsForCall)]
fake.isConfiguredArgsForCall = append(fake.isConfiguredArgsForCall, struct{}{})
fake.recordInvocation("IsConfigured", []interface{}{})
fake.isConfiguredMutex.Unlock()
if fake.IsConfiguredStub != nil {
return fake.IsConfiguredStub()
}
if specificReturn {
return ret.result1
}
return fake.isConfiguredReturns.result1
}
func (fake *FakeAuthConfig) IsConfiguredCallCount() int {
fake.isConfiguredMutex.RLock()
defer fake.isConfiguredMutex.RUnlock()
return len(fake.isConfiguredArgsForCall)
}
func (fake *FakeAuthConfig) IsConfiguredReturns(result1 bool) {
fake.IsConfiguredStub = nil
fake.isConfiguredReturns = struct {
result1 bool
}{result1}
}
func (fake *FakeAuthConfig) IsConfiguredReturnsOnCall(i int, result1 bool) {
fake.IsConfiguredStub = nil
if fake.isConfiguredReturnsOnCall == nil {
fake.isConfiguredReturnsOnCall = make(map[int]struct {
result1 bool
})
}
fake.isConfiguredReturnsOnCall[i] = struct {
result1 bool
}{result1}
}
func (fake *FakeAuthConfig) Validate() error {
fake.validateMutex.Lock()
ret, specificReturn := fake.validateReturnsOnCall[len(fake.validateArgsForCall)]
fake.validateArgsForCall = append(fake.validateArgsForCall, struct{}{})
fake.recordInvocation("Validate", []interface{}{})
fake.validateMutex.Unlock()
if fake.ValidateStub != nil {
return fake.ValidateStub()
}
if specificReturn {
return ret.result1
}
return fake.validateReturns.result1
}
func (fake *FakeAuthConfig) ValidateCallCount() int {
fake.validateMutex.RLock()
defer fake.validateMutex.RUnlock()
return len(fake.validateArgsForCall)
}
func (fake *FakeAuthConfig) ValidateReturns(result1 error) {
fake.ValidateStub = nil
fake.validateReturns = struct {
result1 error
}{result1}
}
func (fake *FakeAuthConfig) ValidateReturnsOnCall(i int, result1 error) {
fake.ValidateStub = nil
if fake.validateReturnsOnCall == nil {
fake.validateReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.validateReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeAuthConfig) AuthMethod(oauthBaseURL string, teamName string) atc.AuthMethod {
fake.authMethodMutex.Lock()
ret, specificReturn := fake.authMethodReturnsOnCall[len(fake.authMethodArgsForCall)]
fake.authMethodArgsForCall = append(fake.authMethodArgsForCall, struct {
oauthBaseURL string
teamName string
}{oauthBaseURL, teamName})
fake.recordInvocation("AuthMethod", []interface{}{oauthBaseURL, teamName})
fake.authMethodMutex.Unlock()
if fake.AuthMethodStub != nil {
return fake.AuthMethodStub(oauthBaseURL, teamName)
}
if specificReturn {
return ret.result1
}
return fake.authMethodReturns.result1
}
func (fake *FakeAuthConfig) AuthMethodCallCount() int {
fake.authMethodMutex.RLock()
defer fake.authMethodMutex.RUnlock()
return len(fake.authMethodArgsForCall)
}
func (fake *FakeAuthConfig) AuthMethodArgsForCall(i int) (string, string) {
fake.authMethodMutex.RLock()
defer fake.authMethodMutex.RUnlock()
return fake.authMethodArgsForCall[i].oauthBaseURL, fake.authMethodArgsForCall[i].teamName
}
func (fake *FakeAuthConfig) AuthMethodReturns(result1 atc.AuthMethod) {
fake.AuthMethodStub = nil
fake.authMethodReturns = struct {
result1 atc.AuthMethod
}{result1}
}
func (fake *FakeAuthConfig) AuthMethodReturnsOnCall(i int, result1 atc.AuthMethod) {
fake.AuthMethodStub = nil
if fake.authMethodReturnsOnCall == nil {
fake.authMethodReturnsOnCall = make(map[int]struct {
result1 atc.AuthMethod
})
}
fake.authMethodReturnsOnCall[i] = struct {
result1 atc.AuthMethod
}{result1}
}
func (fake *FakeAuthConfig) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.isConfiguredMutex.RLock()
defer fake.isConfiguredMutex.RUnlock()
fake.validateMutex.RLock()
defer fake.validateMutex.RUnlock()
fake.authMethodMutex.RLock()
defer fake.authMethodMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeAuthConfig) 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 _ provider.AuthConfig = new(FakeAuthConfig)