forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_orphan_disk.go
265 lines (238 loc) · 6.73 KB
/
fake_orphan_disk.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
// This file was generated by counterfeiter
package directorfakes
import (
"sync"
"time"
"github.com/cloudfoundry/bosh-cli/director"
)
type FakeOrphanDisk struct {
CIDStub func() string
cIDMutex sync.RWMutex
cIDArgsForCall []struct{}
cIDReturns struct {
result1 string
}
SizeStub func() uint64
sizeMutex sync.RWMutex
sizeArgsForCall []struct{}
sizeReturns struct {
result1 uint64
}
DeploymentStub func() director.Deployment
deploymentMutex sync.RWMutex
deploymentArgsForCall []struct{}
deploymentReturns struct {
result1 director.Deployment
}
InstanceNameStub func() string
instanceNameMutex sync.RWMutex
instanceNameArgsForCall []struct{}
instanceNameReturns struct {
result1 string
}
AZNameStub func() string
aZNameMutex sync.RWMutex
aZNameArgsForCall []struct{}
aZNameReturns struct {
result1 string
}
OrphanedAtStub func() time.Time
orphanedAtMutex sync.RWMutex
orphanedAtArgsForCall []struct{}
orphanedAtReturns struct {
result1 time.Time
}
DeleteStub func() error
deleteMutex sync.RWMutex
deleteArgsForCall []struct{}
deleteReturns struct {
result1 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeOrphanDisk) CID() string {
fake.cIDMutex.Lock()
fake.cIDArgsForCall = append(fake.cIDArgsForCall, struct{}{})
fake.recordInvocation("CID", []interface{}{})
fake.cIDMutex.Unlock()
if fake.CIDStub != nil {
return fake.CIDStub()
} else {
return fake.cIDReturns.result1
}
}
func (fake *FakeOrphanDisk) CIDCallCount() int {
fake.cIDMutex.RLock()
defer fake.cIDMutex.RUnlock()
return len(fake.cIDArgsForCall)
}
func (fake *FakeOrphanDisk) CIDReturns(result1 string) {
fake.CIDStub = nil
fake.cIDReturns = struct {
result1 string
}{result1}
}
func (fake *FakeOrphanDisk) Size() uint64 {
fake.sizeMutex.Lock()
fake.sizeArgsForCall = append(fake.sizeArgsForCall, struct{}{})
fake.recordInvocation("Size", []interface{}{})
fake.sizeMutex.Unlock()
if fake.SizeStub != nil {
return fake.SizeStub()
} else {
return fake.sizeReturns.result1
}
}
func (fake *FakeOrphanDisk) SizeCallCount() int {
fake.sizeMutex.RLock()
defer fake.sizeMutex.RUnlock()
return len(fake.sizeArgsForCall)
}
func (fake *FakeOrphanDisk) SizeReturns(result1 uint64) {
fake.SizeStub = nil
fake.sizeReturns = struct {
result1 uint64
}{result1}
}
func (fake *FakeOrphanDisk) Deployment() director.Deployment {
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 *FakeOrphanDisk) DeploymentCallCount() int {
fake.deploymentMutex.RLock()
defer fake.deploymentMutex.RUnlock()
return len(fake.deploymentArgsForCall)
}
func (fake *FakeOrphanDisk) DeploymentReturns(result1 director.Deployment) {
fake.DeploymentStub = nil
fake.deploymentReturns = struct {
result1 director.Deployment
}{result1}
}
func (fake *FakeOrphanDisk) InstanceName() string {
fake.instanceNameMutex.Lock()
fake.instanceNameArgsForCall = append(fake.instanceNameArgsForCall, struct{}{})
fake.recordInvocation("InstanceName", []interface{}{})
fake.instanceNameMutex.Unlock()
if fake.InstanceNameStub != nil {
return fake.InstanceNameStub()
} else {
return fake.instanceNameReturns.result1
}
}
func (fake *FakeOrphanDisk) InstanceNameCallCount() int {
fake.instanceNameMutex.RLock()
defer fake.instanceNameMutex.RUnlock()
return len(fake.instanceNameArgsForCall)
}
func (fake *FakeOrphanDisk) InstanceNameReturns(result1 string) {
fake.InstanceNameStub = nil
fake.instanceNameReturns = struct {
result1 string
}{result1}
}
func (fake *FakeOrphanDisk) AZName() string {
fake.aZNameMutex.Lock()
fake.aZNameArgsForCall = append(fake.aZNameArgsForCall, struct{}{})
fake.recordInvocation("AZName", []interface{}{})
fake.aZNameMutex.Unlock()
if fake.AZNameStub != nil {
return fake.AZNameStub()
} else {
return fake.aZNameReturns.result1
}
}
func (fake *FakeOrphanDisk) AZNameCallCount() int {
fake.aZNameMutex.RLock()
defer fake.aZNameMutex.RUnlock()
return len(fake.aZNameArgsForCall)
}
func (fake *FakeOrphanDisk) AZNameReturns(result1 string) {
fake.AZNameStub = nil
fake.aZNameReturns = struct {
result1 string
}{result1}
}
func (fake *FakeOrphanDisk) OrphanedAt() time.Time {
fake.orphanedAtMutex.Lock()
fake.orphanedAtArgsForCall = append(fake.orphanedAtArgsForCall, struct{}{})
fake.recordInvocation("OrphanedAt", []interface{}{})
fake.orphanedAtMutex.Unlock()
if fake.OrphanedAtStub != nil {
return fake.OrphanedAtStub()
} else {
return fake.orphanedAtReturns.result1
}
}
func (fake *FakeOrphanDisk) OrphanedAtCallCount() int {
fake.orphanedAtMutex.RLock()
defer fake.orphanedAtMutex.RUnlock()
return len(fake.orphanedAtArgsForCall)
}
func (fake *FakeOrphanDisk) OrphanedAtReturns(result1 time.Time) {
fake.OrphanedAtStub = nil
fake.orphanedAtReturns = struct {
result1 time.Time
}{result1}
}
func (fake *FakeOrphanDisk) Delete() error {
fake.deleteMutex.Lock()
fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct{}{})
fake.recordInvocation("Delete", []interface{}{})
fake.deleteMutex.Unlock()
if fake.DeleteStub != nil {
return fake.DeleteStub()
} else {
return fake.deleteReturns.result1
}
}
func (fake *FakeOrphanDisk) DeleteCallCount() int {
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return len(fake.deleteArgsForCall)
}
func (fake *FakeOrphanDisk) DeleteReturns(result1 error) {
fake.DeleteStub = nil
fake.deleteReturns = struct {
result1 error
}{result1}
}
func (fake *FakeOrphanDisk) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.cIDMutex.RLock()
defer fake.cIDMutex.RUnlock()
fake.sizeMutex.RLock()
defer fake.sizeMutex.RUnlock()
fake.deploymentMutex.RLock()
defer fake.deploymentMutex.RUnlock()
fake.instanceNameMutex.RLock()
defer fake.instanceNameMutex.RUnlock()
fake.aZNameMutex.RLock()
defer fake.aZNameMutex.RUnlock()
fake.orphanedAtMutex.RLock()
defer fake.orphanedAtMutex.RUnlock()
fake.deleteMutex.RLock()
defer fake.deleteMutex.RUnlock()
return fake.invocations
}
func (fake *FakeOrphanDisk) 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 _ director.OrphanDisk = new(FakeOrphanDisk)