forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_config.go
215 lines (196 loc) · 5.63 KB
/
fake_config.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
211
212
213
214
215
// Code generated by counterfeiter. DO NOT EDIT.
package releasedirfakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/releasedir"
)
type FakeConfig struct {
NameStub func() (string, error)
nameMutex sync.RWMutex
nameArgsForCall []struct{}
nameReturns struct {
result1 string
result2 error
}
nameReturnsOnCall map[int]struct {
result1 string
result2 error
}
SaveNameStub func(string) error
saveNameMutex sync.RWMutex
saveNameArgsForCall []struct {
arg1 string
}
saveNameReturns struct {
result1 error
}
saveNameReturnsOnCall map[int]struct {
result1 error
}
BlobstoreStub func() (string, map[string]interface{}, error)
blobstoreMutex sync.RWMutex
blobstoreArgsForCall []struct{}
blobstoreReturns struct {
result1 string
result2 map[string]interface{}
result3 error
}
blobstoreReturnsOnCall map[int]struct {
result1 string
result2 map[string]interface{}
result3 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeConfig) Name() (string, error) {
fake.nameMutex.Lock()
ret, specificReturn := fake.nameReturnsOnCall[len(fake.nameArgsForCall)]
fake.nameArgsForCall = append(fake.nameArgsForCall, struct{}{})
fake.recordInvocation("Name", []interface{}{})
fake.nameMutex.Unlock()
if fake.NameStub != nil {
return fake.NameStub()
}
if specificReturn {
return ret.result1, ret.result2
}
return fake.nameReturns.result1, fake.nameReturns.result2
}
func (fake *FakeConfig) NameCallCount() int {
fake.nameMutex.RLock()
defer fake.nameMutex.RUnlock()
return len(fake.nameArgsForCall)
}
func (fake *FakeConfig) NameReturns(result1 string, result2 error) {
fake.NameStub = nil
fake.nameReturns = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *FakeConfig) NameReturnsOnCall(i int, result1 string, result2 error) {
fake.NameStub = nil
if fake.nameReturnsOnCall == nil {
fake.nameReturnsOnCall = make(map[int]struct {
result1 string
result2 error
})
}
fake.nameReturnsOnCall[i] = struct {
result1 string
result2 error
}{result1, result2}
}
func (fake *FakeConfig) SaveName(arg1 string) error {
fake.saveNameMutex.Lock()
ret, specificReturn := fake.saveNameReturnsOnCall[len(fake.saveNameArgsForCall)]
fake.saveNameArgsForCall = append(fake.saveNameArgsForCall, struct {
arg1 string
}{arg1})
fake.recordInvocation("SaveName", []interface{}{arg1})
fake.saveNameMutex.Unlock()
if fake.SaveNameStub != nil {
return fake.SaveNameStub(arg1)
}
if specificReturn {
return ret.result1
}
return fake.saveNameReturns.result1
}
func (fake *FakeConfig) SaveNameCallCount() int {
fake.saveNameMutex.RLock()
defer fake.saveNameMutex.RUnlock()
return len(fake.saveNameArgsForCall)
}
func (fake *FakeConfig) SaveNameArgsForCall(i int) string {
fake.saveNameMutex.RLock()
defer fake.saveNameMutex.RUnlock()
return fake.saveNameArgsForCall[i].arg1
}
func (fake *FakeConfig) SaveNameReturns(result1 error) {
fake.SaveNameStub = nil
fake.saveNameReturns = struct {
result1 error
}{result1}
}
func (fake *FakeConfig) SaveNameReturnsOnCall(i int, result1 error) {
fake.SaveNameStub = nil
if fake.saveNameReturnsOnCall == nil {
fake.saveNameReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.saveNameReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeConfig) Blobstore() (string, map[string]interface{}, error) {
fake.blobstoreMutex.Lock()
ret, specificReturn := fake.blobstoreReturnsOnCall[len(fake.blobstoreArgsForCall)]
fake.blobstoreArgsForCall = append(fake.blobstoreArgsForCall, struct{}{})
fake.recordInvocation("Blobstore", []interface{}{})
fake.blobstoreMutex.Unlock()
if fake.BlobstoreStub != nil {
return fake.BlobstoreStub()
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
return fake.blobstoreReturns.result1, fake.blobstoreReturns.result2, fake.blobstoreReturns.result3
}
func (fake *FakeConfig) BlobstoreCallCount() int {
fake.blobstoreMutex.RLock()
defer fake.blobstoreMutex.RUnlock()
return len(fake.blobstoreArgsForCall)
}
func (fake *FakeConfig) BlobstoreReturns(result1 string, result2 map[string]interface{}, result3 error) {
fake.BlobstoreStub = nil
fake.blobstoreReturns = struct {
result1 string
result2 map[string]interface{}
result3 error
}{result1, result2, result3}
}
func (fake *FakeConfig) BlobstoreReturnsOnCall(i int, result1 string, result2 map[string]interface{}, result3 error) {
fake.BlobstoreStub = nil
if fake.blobstoreReturnsOnCall == nil {
fake.blobstoreReturnsOnCall = make(map[int]struct {
result1 string
result2 map[string]interface{}
result3 error
})
}
fake.blobstoreReturnsOnCall[i] = struct {
result1 string
result2 map[string]interface{}
result3 error
}{result1, result2, result3}
}
func (fake *FakeConfig) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.nameMutex.RLock()
defer fake.nameMutex.RUnlock()
fake.saveNameMutex.RLock()
defer fake.saveNameMutex.RUnlock()
fake.blobstoreMutex.RLock()
defer fake.blobstoreMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeConfig) 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 _ releasedir.Config = new(FakeConfig)