-
Notifications
You must be signed in to change notification settings - Fork 161
/
fake_session_context.go
166 lines (148 loc) · 4.46 KB
/
fake_session_context.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
// This file was generated by counterfeiter
package cmdfakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/cmd"
"github.com/cloudfoundry/bosh-cli/cmd/config"
)
type FakeSessionContext struct {
EnvironmentStub func() string
environmentMutex sync.RWMutex
environmentArgsForCall []struct{}
environmentReturns struct {
result1 string
}
CACertStub func() string
cACertMutex sync.RWMutex
cACertArgsForCall []struct{}
cACertReturns struct {
result1 string
}
CredentialsStub func() config.Creds
credentialsMutex sync.RWMutex
credentialsArgsForCall []struct{}
credentialsReturns struct {
result1 config.Creds
}
DeploymentStub func() string
deploymentMutex sync.RWMutex
deploymentArgsForCall []struct{}
deploymentReturns struct {
result1 string
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeSessionContext) Environment() string {
fake.environmentMutex.Lock()
fake.environmentArgsForCall = append(fake.environmentArgsForCall, struct{}{})
fake.recordInvocation("Environment", []interface{}{})
fake.environmentMutex.Unlock()
if fake.EnvironmentStub != nil {
return fake.EnvironmentStub()
} else {
return fake.environmentReturns.result1
}
}
func (fake *FakeSessionContext) EnvironmentCallCount() int {
fake.environmentMutex.RLock()
defer fake.environmentMutex.RUnlock()
return len(fake.environmentArgsForCall)
}
func (fake *FakeSessionContext) EnvironmentReturns(result1 string) {
fake.EnvironmentStub = nil
fake.environmentReturns = struct {
result1 string
}{result1}
}
func (fake *FakeSessionContext) CACert() string {
fake.cACertMutex.Lock()
fake.cACertArgsForCall = append(fake.cACertArgsForCall, struct{}{})
fake.recordInvocation("CACert", []interface{}{})
fake.cACertMutex.Unlock()
if fake.CACertStub != nil {
return fake.CACertStub()
} else {
return fake.cACertReturns.result1
}
}
func (fake *FakeSessionContext) CACertCallCount() int {
fake.cACertMutex.RLock()
defer fake.cACertMutex.RUnlock()
return len(fake.cACertArgsForCall)
}
func (fake *FakeSessionContext) CACertReturns(result1 string) {
fake.CACertStub = nil
fake.cACertReturns = struct {
result1 string
}{result1}
}
func (fake *FakeSessionContext) Credentials() config.Creds {
fake.credentialsMutex.Lock()
fake.credentialsArgsForCall = append(fake.credentialsArgsForCall, struct{}{})
fake.recordInvocation("Credentials", []interface{}{})
fake.credentialsMutex.Unlock()
if fake.CredentialsStub != nil {
return fake.CredentialsStub()
} else {
return fake.credentialsReturns.result1
}
}
func (fake *FakeSessionContext) CredentialsCallCount() int {
fake.credentialsMutex.RLock()
defer fake.credentialsMutex.RUnlock()
return len(fake.credentialsArgsForCall)
}
func (fake *FakeSessionContext) CredentialsReturns(result1 config.Creds) {
fake.CredentialsStub = nil
fake.credentialsReturns = struct {
result1 config.Creds
}{result1}
}
func (fake *FakeSessionContext) Deployment() string {
fake.deploymentMutex.Lock()
fake.deploymentArgsForCall = append(fake.deploymentArgsForCall, struct{}{})
fake.recordInvocation("Deployment", []interface{}{})
fake.deploymentMutex.Unlock()
if fake.DeploymentStub != nil {
return fake.DeploymentStub()
} else {
return fake.deploymentReturns.result1
}
}
func (fake *FakeSessionContext) DeploymentCallCount() int {
fake.deploymentMutex.RLock()
defer fake.deploymentMutex.RUnlock()
return len(fake.deploymentArgsForCall)
}
func (fake *FakeSessionContext) DeploymentReturns(result1 string) {
fake.DeploymentStub = nil
fake.deploymentReturns = struct {
result1 string
}{result1}
}
func (fake *FakeSessionContext) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.environmentMutex.RLock()
defer fake.environmentMutex.RUnlock()
fake.cACertMutex.RLock()
defer fake.cACertMutex.RUnlock()
fake.credentialsMutex.RLock()
defer fake.credentialsMutex.RUnlock()
fake.deploymentMutex.RLock()
defer fake.deploymentMutex.RUnlock()
return fake.invocations
}
func (fake *FakeSessionContext) 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 _ cmd.SessionContext = new(FakeSessionContext)