-
Notifications
You must be signed in to change notification settings - Fork 161
/
fake_release_index.go
224 lines (200 loc) · 5.95 KB
/
fake_release_index.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
// This file was generated by counterfeiter
package fakes
import (
"sync"
boshrel "github.com/cloudfoundry/bosh-cli/release"
boshrelman "github.com/cloudfoundry/bosh-cli/release/manifest"
"github.com/cloudfoundry/bosh-cli/releasedir"
semver "github.com/cppforlife/go-semi-semantic/version"
)
type FakeReleaseIndex struct {
LastVersionStub func(name string) (*semver.Version, error)
lastVersionMutex sync.RWMutex
lastVersionArgsForCall []struct {
name string
}
lastVersionReturns struct {
result1 *semver.Version
result2 error
}
ContainsStub func(boshrel.Release) (bool, error)
containsMutex sync.RWMutex
containsArgsForCall []struct {
arg1 boshrel.Release
}
containsReturns struct {
result1 bool
result2 error
}
AddStub func(boshrelman.Manifest) error
addMutex sync.RWMutex
addArgsForCall []struct {
arg1 boshrelman.Manifest
}
addReturns struct {
result1 error
}
ManifestPathStub func(name, version string) string
manifestPathMutex sync.RWMutex
manifestPathArgsForCall []struct {
name string
version string
}
manifestPathReturns struct {
result1 string
}
ArchivePathStub func(boshrel.Release) (string, error)
archivePathMutex sync.RWMutex
archivePathArgsForCall []struct {
arg1 boshrel.Release
}
archivePathReturns struct {
result1 string
result2 error
}
}
func (fake *FakeReleaseIndex) LastVersion(name string) (*semver.Version, error) {
fake.lastVersionMutex.Lock()
fake.lastVersionArgsForCall = append(fake.lastVersionArgsForCall, struct {
name string
}{name})
fake.lastVersionMutex.Unlock()
if fake.LastVersionStub != nil {
return fake.LastVersionStub(name)
} else {
return fake.lastVersionReturns.result1, fake.lastVersionReturns.result2
}
}
func (fake *FakeReleaseIndex) LastVersionCallCount() int {
fake.lastVersionMutex.RLock()
defer fake.lastVersionMutex.RUnlock()
return len(fake.lastVersionArgsForCall)
}
func (fake *FakeReleaseIndex) LastVersionArgsForCall(i int) string {
fake.lastVersionMutex.RLock()
defer fake.lastVersionMutex.RUnlock()
return fake.lastVersionArgsForCall[i].name
}
func (fake *FakeReleaseIndex) LastVersionReturns(result1 *semver.Version, result2 error) {
fake.LastVersionStub = nil
fake.lastVersionReturns = struct {
result1 *semver.Version
result2 error
}{result1, result2}
}
func (fake *FakeReleaseIndex) Contains(arg1 boshrel.Release) (bool, error) {
fake.containsMutex.Lock()
fake.containsArgsForCall = append(fake.containsArgsForCall, struct {
arg1 boshrel.Release
}{arg1})
fake.containsMutex.Unlock()
if fake.ContainsStub != nil {
return fake.ContainsStub(arg1)
} else {
return fake.containsReturns.result1, fake.containsReturns.result2
}
}
func (fake *FakeReleaseIndex) ContainsCallCount() int {
fake.containsMutex.RLock()
defer fake.containsMutex.RUnlock()
return len(fake.containsArgsForCall)
}
func (fake *FakeReleaseIndex) ContainsArgsForCall(i int) boshrel.Release {
fake.containsMutex.RLock()
defer fake.containsMutex.RUnlock()
return fake.containsArgsForCall[i].arg1
}
func (fake *FakeReleaseIndex) ContainsReturns(result1 bool, result2 error) {
fake.ContainsStub = nil
fake.containsReturns = struct {
result1 bool
result2 error
}{result1, result2}
}
func (fake *FakeReleaseIndex) Add(arg1 boshrelman.Manifest) error {
fake.addMutex.Lock()
fake.addArgsForCall = append(fake.addArgsForCall, struct {
arg1 boshrelman.Manifest
}{arg1})
fake.addMutex.Unlock()
if fake.AddStub != nil {
return fake.AddStub(arg1)
} else {
return fake.addReturns.result1
}
}
func (fake *FakeReleaseIndex) AddCallCount() int {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return len(fake.addArgsForCall)
}
func (fake *FakeReleaseIndex) AddArgsForCall(i int) boshrelman.Manifest {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return fake.addArgsForCall[i].arg1
}
func (fake *FakeReleaseIndex) AddReturns(result1 error) {
fake.AddStub = nil
fake.addReturns = struct {
result1 error
}{result1}
}
func (fake *FakeReleaseIndex) ManifestPath(name string, version string) string {
fake.manifestPathMutex.Lock()
fake.manifestPathArgsForCall = append(fake.manifestPathArgsForCall, struct {
name string
version string
}{name, version})
fake.manifestPathMutex.Unlock()
if fake.ManifestPathStub != nil {
return fake.ManifestPathStub(name, version)
} else {
return fake.manifestPathReturns.result1
}
}
func (fake *FakeReleaseIndex) ManifestPathCallCount() int {
fake.manifestPathMutex.RLock()
defer fake.manifestPathMutex.RUnlock()
return len(fake.manifestPathArgsForCall)
}
func (fake *FakeReleaseIndex) ManifestPathArgsForCall(i int) (string, string) {
fake.manifestPathMutex.RLock()
defer fake.manifestPathMutex.RUnlock()
return fake.manifestPathArgsForCall[i].name, fake.manifestPathArgsForCall[i].version
}
func (fake *FakeReleaseIndex) ManifestPathReturns(result1 string) {
fake.ManifestPathStub = nil
fake.manifestPathReturns = struct {
result1 string
}{result1}
}
func (fake *FakeReleaseIndex) ArchivePath(arg1 boshrel.Release) (string, error) {
fake.archivePathMutex.Lock()
fake.archivePathArgsForCall = append(fake.archivePathArgsForCall, struct {
arg1 boshrel.Release
}{arg1})
fake.archivePathMutex.Unlock()
if fake.ArchivePathStub != nil {
return fake.ArchivePathStub(arg1)
} else {
return fake.archivePathReturns.result1, fake.archivePathReturns.result2
}
}
func (fake *FakeReleaseIndex) ArchivePathCallCount() int {
fake.archivePathMutex.RLock()
defer fake.archivePathMutex.RUnlock()
return len(fake.archivePathArgsForCall)
}
func (fake *FakeReleaseIndex) ArchivePathArgsForCall(i int) boshrel.Release {
fake.archivePathMutex.RLock()
defer fake.archivePathMutex.RUnlock()
return fake.archivePathArgsForCall[i].arg1
}
func (fake *FakeReleaseIndex) ArchivePathReturns(result1 string, result2 error) {
fake.ArchivePathStub = nil
fake.archivePathReturns = struct {
result1 string
result2 error
}{result1, result2}
}
var _ releasedir.ReleaseIndex = new(FakeReleaseIndex)