forked from cloudfoundry-community/cloudfoundry-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_service_auth_token_repository.go
210 lines (187 loc) · 6.47 KB
/
fake_service_auth_token_repository.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
// This file was generated by counterfeiter
package apifakes
import (
"sync"
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/models"
)
type FakeServiceAuthTokenRepository struct {
FindAllStub func() (authTokens []models.ServiceAuthTokenFields, apiErr error)
findAllMutex sync.RWMutex
findAllArgsForCall []struct{}
findAllReturns struct {
result1 []models.ServiceAuthTokenFields
result2 error
}
FindByLabelAndProviderStub func(label, provider string) (authToken models.ServiceAuthTokenFields, apiErr error)
findByLabelAndProviderMutex sync.RWMutex
findByLabelAndProviderArgsForCall []struct {
label string
provider string
}
findByLabelAndProviderReturns struct {
result1 models.ServiceAuthTokenFields
result2 error
}
CreateStub func(authToken models.ServiceAuthTokenFields) (apiErr error)
createMutex sync.RWMutex
createArgsForCall []struct {
authToken models.ServiceAuthTokenFields
}
createReturns struct {
result1 error
}
UpdateStub func(authToken models.ServiceAuthTokenFields) (apiErr error)
updateMutex sync.RWMutex
updateArgsForCall []struct {
authToken models.ServiceAuthTokenFields
}
updateReturns struct {
result1 error
}
DeleteStub func(authToken models.ServiceAuthTokenFields) (apiErr error)
deleteMutex sync.RWMutex
deleteArgsForCall []struct {
authToken models.ServiceAuthTokenFields
}
deleteReturns struct {
result1 error
}
}
func (fake *FakeServiceAuthTokenRepository) FindAll() (authTokens []models.ServiceAuthTokenFields, apiErr error) {
fake.findAllMutex.Lock()
fake.findAllArgsForCall = append(fake.findAllArgsForCall, struct{}{})
fake.findAllMutex.Unlock()
if fake.FindAllStub != nil {
return fake.FindAllStub()
} else {
return fake.findAllReturns.result1, fake.findAllReturns.result2
}
}
func (fake *FakeServiceAuthTokenRepository) FindAllCallCount() int {
fake.findAllMutex.RLock()
defer fake.findAllMutex.RUnlock()
return len(fake.findAllArgsForCall)
}
func (fake *FakeServiceAuthTokenRepository) FindAllReturns(result1 []models.ServiceAuthTokenFields, result2 error) {
fake.FindAllStub = nil
fake.findAllReturns = struct {
result1 []models.ServiceAuthTokenFields
result2 error
}{result1, result2}
}
func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProvider(label string, provider string) (authToken models.ServiceAuthTokenFields, apiErr error) {
fake.findByLabelAndProviderMutex.Lock()
fake.findByLabelAndProviderArgsForCall = append(fake.findByLabelAndProviderArgsForCall, struct {
label string
provider string
}{label, provider})
fake.findByLabelAndProviderMutex.Unlock()
if fake.FindByLabelAndProviderStub != nil {
return fake.FindByLabelAndProviderStub(label, provider)
} else {
return fake.findByLabelAndProviderReturns.result1, fake.findByLabelAndProviderReturns.result2
}
}
func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderCallCount() int {
fake.findByLabelAndProviderMutex.RLock()
defer fake.findByLabelAndProviderMutex.RUnlock()
return len(fake.findByLabelAndProviderArgsForCall)
}
func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderArgsForCall(i int) (string, string) {
fake.findByLabelAndProviderMutex.RLock()
defer fake.findByLabelAndProviderMutex.RUnlock()
return fake.findByLabelAndProviderArgsForCall[i].label, fake.findByLabelAndProviderArgsForCall[i].provider
}
func (fake *FakeServiceAuthTokenRepository) FindByLabelAndProviderReturns(result1 models.ServiceAuthTokenFields, result2 error) {
fake.FindByLabelAndProviderStub = nil
fake.findByLabelAndProviderReturns = struct {
result1 models.ServiceAuthTokenFields
result2 error
}{result1, result2}
}
func (fake *FakeServiceAuthTokenRepository) Create(authToken models.ServiceAuthTokenFields) (apiErr error) {
fake.createMutex.Lock()
fake.createArgsForCall = append(fake.createArgsForCall, struct {
authToken models.ServiceAuthTokenFields
}{authToken})
fake.createMutex.Unlock()
if fake.CreateStub != nil {
return fake.CreateStub(authToken)
} else {
return fake.createReturns.result1
}
}
func (fake *FakeServiceAuthTokenRepository) CreateCallCount() int {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return len(fake.createArgsForCall)
}
func (fake *FakeServiceAuthTokenRepository) CreateArgsForCall(i int) models.ServiceAuthTokenFields {
fake.createMutex.RLock()
defer fake.createMutex.RUnlock()
return fake.createArgsForCall[i].authToken
}
func (fake *FakeServiceAuthTokenRepository) CreateReturns(result1 error) {
fake.CreateStub = nil
fake.createReturns = struct {
result1 error
}{result1}
}
func (fake *FakeServiceAuthTokenRepository) Update(authToken models.ServiceAuthTokenFields) (apiErr error) {
fake.updateMutex.Lock()
fake.updateArgsForCall = append(fake.updateArgsForCall, struct {
authToken models.ServiceAuthTokenFields
}{authToken})
fake.updateMutex.Unlock()
if fake.UpdateStub != nil {
return fake.UpdateStub(authToken)
} else {
return fake.updateReturns.result1
}
}
func (fake *FakeServiceAuthTokenRepository) UpdateCallCount() int {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return len(fake.updateArgsForCall)
}
func (fake *FakeServiceAuthTokenRepository) UpdateArgsForCall(i int) models.ServiceAuthTokenFields {
fake.updateMutex.RLock()
defer fake.updateMutex.RUnlock()
return fake.updateArgsForCall[i].authToken
}
func (fake *FakeServiceAuthTokenRepository) UpdateReturns(result1 error) {
fake.UpdateStub = nil
fake.updateReturns = struct {
result1 error
}{result1}
}
func (fake *FakeServiceAuthTokenRepository) Delete(authToken models.ServiceAuthTokenFields) (apiErr error) {
fake.deleteMutex.Lock()
fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct {
authToken models.ServiceAuthTokenFields
}{authToken})
fake.deleteMutex.Unlock()
if fake.DeleteStub != nil {
return fake.DeleteStub(authToken)
} else {
return fake.deleteReturns.result1
}
}
func (fake *FakeServiceAuthTokenRepository) DeleteCallCount() int {
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return len(fake.deleteArgsForCall)
}
func (fake *FakeServiceAuthTokenRepository) DeleteArgsForCall(i int) models.ServiceAuthTokenFields {
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return fake.deleteArgsForCall[i].authToken
}
func (fake *FakeServiceAuthTokenRepository) DeleteReturns(result1 error) {
fake.DeleteStub = nil
fake.deleteReturns = struct {
result1 error
}{result1}
}
var _ api.ServiceAuthTokenRepository = new(FakeServiceAuthTokenRepository)