forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_access_token.go
167 lines (149 loc) · 4.28 KB
/
fake_access_token.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
// This file was generated by counterfeiter
package uaafakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/uaa"
)
type FakeAccessToken struct {
TypeStub func() string
typeMutex sync.RWMutex
typeArgsForCall []struct{}
typeReturns struct {
result1 string
}
ValueStub func() string
valueMutex sync.RWMutex
valueArgsForCall []struct{}
valueReturns struct {
result1 string
}
RefreshTokenStub func() uaa.Token
refreshTokenMutex sync.RWMutex
refreshTokenArgsForCall []struct{}
refreshTokenReturns struct {
result1 uaa.Token
}
RefreshStub func() (uaa.AccessToken, error)
refreshMutex sync.RWMutex
refreshArgsForCall []struct{}
refreshReturns struct {
result1 uaa.AccessToken
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeAccessToken) Type() string {
fake.typeMutex.Lock()
fake.typeArgsForCall = append(fake.typeArgsForCall, struct{}{})
fake.recordInvocation("Type", []interface{}{})
fake.typeMutex.Unlock()
if fake.TypeStub != nil {
return fake.TypeStub()
} else {
return fake.typeReturns.result1
}
}
func (fake *FakeAccessToken) TypeCallCount() int {
fake.typeMutex.RLock()
defer fake.typeMutex.RUnlock()
return len(fake.typeArgsForCall)
}
func (fake *FakeAccessToken) TypeReturns(result1 string) {
fake.TypeStub = nil
fake.typeReturns = struct {
result1 string
}{result1}
}
func (fake *FakeAccessToken) Value() string {
fake.valueMutex.Lock()
fake.valueArgsForCall = append(fake.valueArgsForCall, struct{}{})
fake.recordInvocation("Value", []interface{}{})
fake.valueMutex.Unlock()
if fake.ValueStub != nil {
return fake.ValueStub()
} else {
return fake.valueReturns.result1
}
}
func (fake *FakeAccessToken) ValueCallCount() int {
fake.valueMutex.RLock()
defer fake.valueMutex.RUnlock()
return len(fake.valueArgsForCall)
}
func (fake *FakeAccessToken) ValueReturns(result1 string) {
fake.ValueStub = nil
fake.valueReturns = struct {
result1 string
}{result1}
}
func (fake *FakeAccessToken) RefreshToken() uaa.Token {
fake.refreshTokenMutex.Lock()
fake.refreshTokenArgsForCall = append(fake.refreshTokenArgsForCall, struct{}{})
fake.recordInvocation("RefreshToken", []interface{}{})
fake.refreshTokenMutex.Unlock()
if fake.RefreshTokenStub != nil {
return fake.RefreshTokenStub()
} else {
return fake.refreshTokenReturns.result1
}
}
func (fake *FakeAccessToken) RefreshTokenCallCount() int {
fake.refreshTokenMutex.RLock()
defer fake.refreshTokenMutex.RUnlock()
return len(fake.refreshTokenArgsForCall)
}
func (fake *FakeAccessToken) RefreshTokenReturns(result1 uaa.Token) {
fake.RefreshTokenStub = nil
fake.refreshTokenReturns = struct {
result1 uaa.Token
}{result1}
}
func (fake *FakeAccessToken) Refresh() (uaa.AccessToken, error) {
fake.refreshMutex.Lock()
fake.refreshArgsForCall = append(fake.refreshArgsForCall, struct{}{})
fake.recordInvocation("Refresh", []interface{}{})
fake.refreshMutex.Unlock()
if fake.RefreshStub != nil {
return fake.RefreshStub()
} else {
return fake.refreshReturns.result1, fake.refreshReturns.result2
}
}
func (fake *FakeAccessToken) RefreshCallCount() int {
fake.refreshMutex.RLock()
defer fake.refreshMutex.RUnlock()
return len(fake.refreshArgsForCall)
}
func (fake *FakeAccessToken) RefreshReturns(result1 uaa.AccessToken, result2 error) {
fake.RefreshStub = nil
fake.refreshReturns = struct {
result1 uaa.AccessToken
result2 error
}{result1, result2}
}
func (fake *FakeAccessToken) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.typeMutex.RLock()
defer fake.typeMutex.RUnlock()
fake.valueMutex.RLock()
defer fake.valueMutex.RUnlock()
fake.refreshTokenMutex.RLock()
defer fake.refreshTokenMutex.RUnlock()
fake.refreshMutex.RLock()
defer fake.refreshMutex.RUnlock()
return fake.invocations
}
func (fake *FakeAccessToken) 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.AccessToken = new(FakeAccessToken)