-
Notifications
You must be signed in to change notification settings - Fork 72
/
uua_client.go
156 lines (143 loc) · 4.3 KB
/
uua_client.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
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"policy-server/uaa_client"
"sync"
)
type UAAClient struct {
GetTokenStub func() (string, error)
getTokenMutex sync.RWMutex
getTokenArgsForCall []struct{}
getTokenReturns struct {
result1 string
result2 error
}
getTokenReturnsOnCall map[int]struct {
result1 string
result2 error
}
CheckTokenStub func(string) (uaa_client.CheckTokenResponse, error)
checkTokenMutex sync.RWMutex
checkTokenArgsForCall []struct {
arg1 string
}
checkTokenReturns struct {
result1 uaa_client.CheckTokenResponse
result2 error
}
checkTokenReturnsOnCall map[int]struct {
result1 uaa_client.CheckTokenResponse
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *UAAClient) GetToken() (string, error) {
fake.getTokenMutex.Lock()
ret, specificReturn := fake.getTokenReturnsOnCall[len(fake.getTokenArgsForCall)]
fake.getTokenArgsForCall = append(fake.getTokenArgsForCall, struct{}{})
fake.recordInvocation("GetToken", []interface{}{})
fake.getTokenMutex.Unlock()
if fake.GetTokenStub != nil {
return fake.GetTokenStub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.getTokenReturns.result1, fake.getTokenReturns.result2
}
func (fake *UAAClient) GetTokenCallCount() int {
fake.getTokenMutex.RLock()
defer fake.getTokenMutex.RUnlock()
return len(fake.getTokenArgsForCall)
}
func (fake *UAAClient) GetTokenReturns(result1 string, result2 error) {
fake.GetTokenStub = nil
fake.getTokenReturns = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *UAAClient) GetTokenReturnsOnCall(i int, result1 string, result2 error) {
fake.GetTokenStub = nil
if fake.getTokenReturnsOnCall == nil {
fake.getTokenReturnsOnCall = make(map[int]struct {
result1 string
result2 error
})
}
fake.getTokenReturnsOnCall[i] = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *UAAClient) CheckToken(arg1 string) (uaa_client.CheckTokenResponse, error) {
fake.checkTokenMutex.Lock()
ret, specificReturn := fake.checkTokenReturnsOnCall[len(fake.checkTokenArgsForCall)]
fake.checkTokenArgsForCall = append(fake.checkTokenArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("CheckToken", []interface{}{arg1})
fake.checkTokenMutex.Unlock()
if fake.CheckTokenStub != nil {
return fake.CheckTokenStub(arg1)
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.checkTokenReturns.result1, fake.checkTokenReturns.result2
}
func (fake *UAAClient) CheckTokenCallCount() int {
fake.checkTokenMutex.RLock()
defer fake.checkTokenMutex.RUnlock()
return len(fake.checkTokenArgsForCall)
}
func (fake *UAAClient) CheckTokenArgsForCall(i int) string {
fake.checkTokenMutex.RLock()
defer fake.checkTokenMutex.RUnlock()
return fake.checkTokenArgsForCall[i].arg1
}
func (fake *UAAClient) CheckTokenReturns(result1 uaa_client.CheckTokenResponse, result2 error) {
fake.CheckTokenStub = nil
fake.checkTokenReturns = struct {
result1 uaa_client.CheckTokenResponse
result2 error
}{result1, result2}
}
func (fake *UAAClient) CheckTokenReturnsOnCall(i int, result1 uaa_client.CheckTokenResponse, result2 error) {
fake.CheckTokenStub = nil
if fake.checkTokenReturnsOnCall == nil {
fake.checkTokenReturnsOnCall = make(map[int]struct {
result1 uaa_client.CheckTokenResponse
result2 error
})
}
fake.checkTokenReturnsOnCall[i] = struct {
result1 uaa_client.CheckTokenResponse
result2 error
}{result1, result2}
}
func (fake *UAAClient) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.getTokenMutex.RLock()
defer fake.getTokenMutex.RUnlock()
fake.checkTokenMutex.RLock()
defer fake.checkTokenMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *UAAClient) 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)
}