forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_session.go
204 lines (182 loc) · 5.54 KB
/
fake_session.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/cmd"
cmdconf "github.com/cloudfoundry/bosh-cli/cmd/config"
boshdir "github.com/cloudfoundry/bosh-cli/director"
boshuaa "github.com/cloudfoundry/bosh-cli/uaa"
)
type FakeSession struct {
EnvironmentStub func() string
environmentMutex sync.RWMutex
environmentArgsForCall []struct{}
environmentReturns struct {
result1 string
}
CredentialsStub func() cmdconf.Creds
credentialsMutex sync.RWMutex
credentialsArgsForCall []struct{}
credentialsReturns struct {
result1 cmdconf.Creds
}
UAAStub func() (boshuaa.UAA, error)
uAAMutex sync.RWMutex
uAAArgsForCall []struct{}
uAAReturns struct {
result1 boshuaa.UAA
result2 error
}
DirectorStub func() (boshdir.Director, error)
directorMutex sync.RWMutex
directorArgsForCall []struct{}
directorReturns struct {
result1 boshdir.Director
result2 error
}
AnonymousDirectorStub func() (boshdir.Director, error)
anonymousDirectorMutex sync.RWMutex
anonymousDirectorArgsForCall []struct{}
anonymousDirectorReturns struct {
result1 boshdir.Director
result2 error
}
DeploymentStub func() (boshdir.Deployment, error)
deploymentMutex sync.RWMutex
deploymentArgsForCall []struct{}
deploymentReturns struct {
result1 boshdir.Deployment
result2 error
}
}
func (fake *FakeSession) Environment() string {
fake.environmentMutex.Lock()
fake.environmentArgsForCall = append(fake.environmentArgsForCall, struct{}{})
fake.environmentMutex.Unlock()
if fake.EnvironmentStub != nil {
return fake.EnvironmentStub()
} else {
return fake.environmentReturns.result1
}
}
func (fake *FakeSession) EnvironmentCallCount() int {
fake.environmentMutex.RLock()
defer fake.environmentMutex.RUnlock()
return len(fake.environmentArgsForCall)
}
func (fake *FakeSession) EnvironmentReturns(result1 string) {
fake.EnvironmentStub = nil
fake.environmentReturns = struct {
result1 string
}{result1}
}
func (fake *FakeSession) Credentials() cmdconf.Creds {
fake.credentialsMutex.Lock()
fake.credentialsArgsForCall = append(fake.credentialsArgsForCall, struct{}{})
fake.credentialsMutex.Unlock()
if fake.CredentialsStub != nil {
return fake.CredentialsStub()
} else {
return fake.credentialsReturns.result1
}
}
func (fake *FakeSession) CredentialsCallCount() int {
fake.credentialsMutex.RLock()
defer fake.credentialsMutex.RUnlock()
return len(fake.credentialsArgsForCall)
}
func (fake *FakeSession) CredentialsReturns(result1 cmdconf.Creds) {
fake.CredentialsStub = nil
fake.credentialsReturns = struct {
result1 cmdconf.Creds
}{result1}
}
func (fake *FakeSession) UAA() (boshuaa.UAA, error) {
fake.uAAMutex.Lock()
fake.uAAArgsForCall = append(fake.uAAArgsForCall, struct{}{})
fake.uAAMutex.Unlock()
if fake.UAAStub != nil {
return fake.UAAStub()
} else {
return fake.uAAReturns.result1, fake.uAAReturns.result2
}
}
func (fake *FakeSession) UAACallCount() int {
fake.uAAMutex.RLock()
defer fake.uAAMutex.RUnlock()
return len(fake.uAAArgsForCall)
}
func (fake *FakeSession) UAAReturns(result1 boshuaa.UAA, result2 error) {
fake.UAAStub = nil
fake.uAAReturns = struct {
result1 boshuaa.UAA
result2 error
}{result1, result2}
}
func (fake *FakeSession) Director() (boshdir.Director, error) {
fake.directorMutex.Lock()
fake.directorArgsForCall = append(fake.directorArgsForCall, struct{}{})
fake.directorMutex.Unlock()
if fake.DirectorStub != nil {
return fake.DirectorStub()
} else {
return fake.directorReturns.result1, fake.directorReturns.result2
}
}
func (fake *FakeSession) DirectorCallCount() int {
fake.directorMutex.RLock()
defer fake.directorMutex.RUnlock()
return len(fake.directorArgsForCall)
}
func (fake *FakeSession) DirectorReturns(result1 boshdir.Director, result2 error) {
fake.DirectorStub = nil
fake.directorReturns = struct {
result1 boshdir.Director
result2 error
}{result1, result2}
}
func (fake *FakeSession) AnonymousDirector() (boshdir.Director, error) {
fake.anonymousDirectorMutex.Lock()
fake.anonymousDirectorArgsForCall = append(fake.anonymousDirectorArgsForCall, struct{}{})
fake.anonymousDirectorMutex.Unlock()
if fake.AnonymousDirectorStub != nil {
return fake.AnonymousDirectorStub()
} else {
return fake.anonymousDirectorReturns.result1, fake.anonymousDirectorReturns.result2
}
}
func (fake *FakeSession) AnonymousDirectorCallCount() int {
fake.anonymousDirectorMutex.RLock()
defer fake.anonymousDirectorMutex.RUnlock()
return len(fake.anonymousDirectorArgsForCall)
}
func (fake *FakeSession) AnonymousDirectorReturns(result1 boshdir.Director, result2 error) {
fake.AnonymousDirectorStub = nil
fake.anonymousDirectorReturns = struct {
result1 boshdir.Director
result2 error
}{result1, result2}
}
func (fake *FakeSession) Deployment() (boshdir.Deployment, error) {
fake.deploymentMutex.Lock()
fake.deploymentArgsForCall = append(fake.deploymentArgsForCall, struct{}{})
fake.deploymentMutex.Unlock()
if fake.DeploymentStub != nil {
return fake.DeploymentStub()
} else {
return fake.deploymentReturns.result1, fake.deploymentReturns.result2
}
}
func (fake *FakeSession) DeploymentCallCount() int {
fake.deploymentMutex.RLock()
defer fake.deploymentMutex.RUnlock()
return len(fake.deploymentArgsForCall)
}
func (fake *FakeSession) DeploymentReturns(result1 boshdir.Deployment, result2 error) {
fake.DeploymentStub = nil
fake.deploymentReturns = struct {
result1 boshdir.Deployment
result2 error
}{result1, result2}
}
var _ cmd.Session = new(FakeSession)