forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_archive_index.go
187 lines (171 loc) · 5.06 KB
/
fake_archive_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
// Code generated by counterfeiter. DO NOT EDIT.
package resourcefakes
import (
"sync"
"github.com/cloudfoundry/bosh-cli/release/resource"
)
type FakeArchiveIndex struct {
FindStub func(name, fingerprint string) (string, string, error)
findMutex sync.RWMutex
findArgsForCall []struct {
name string
fingerprint string
}
findReturns struct {
result1 string
result2 string
result3 error
}
findReturnsOnCall map[int]struct {
result1 string
result2 string
result3 error
}
AddStub func(name, fingerprint, path, sha1 string) (string, string, error)
addMutex sync.RWMutex
addArgsForCall []struct {
name string
fingerprint string
path string
sha1 string
}
addReturns struct {
result1 string
result2 string
result3 error
}
addReturnsOnCall map[int]struct {
result1 string
result2 string
result3 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeArchiveIndex) Find(name string, fingerprint string) (string, string, error) {
fake.findMutex.Lock()
ret, specificReturn := fake.findReturnsOnCall[len(fake.findArgsForCall)]
fake.findArgsForCall = append(fake.findArgsForCall, struct {
name string
fingerprint string
}{name, fingerprint})
fake.recordInvocation("Find", []interface{}{name, fingerprint})
fake.findMutex.Unlock()
if fake.FindStub != nil {
return fake.FindStub(name, fingerprint)
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
return fake.findReturns.result1, fake.findReturns.result2, fake.findReturns.result3
}
func (fake *FakeArchiveIndex) FindCallCount() int {
fake.findMutex.RLock()
defer fake.findMutex.RUnlock()
return len(fake.findArgsForCall)
}
func (fake *FakeArchiveIndex) FindArgsForCall(i int) (string, string) {
fake.findMutex.RLock()
defer fake.findMutex.RUnlock()
return fake.findArgsForCall[i].name, fake.findArgsForCall[i].fingerprint
}
func (fake *FakeArchiveIndex) FindReturns(result1 string, result2 string, result3 error) {
fake.FindStub = nil
fake.findReturns = struct {
result1 string
result2 string
result3 error
}{result1, result2, result3}
}
func (fake *FakeArchiveIndex) FindReturnsOnCall(i int, result1 string, result2 string, result3 error) {
fake.FindStub = nil
if fake.findReturnsOnCall == nil {
fake.findReturnsOnCall = make(map[int]struct {
result1 string
result2 string
result3 error
})
}
fake.findReturnsOnCall[i] = struct {
result1 string
result2 string
result3 error
}{result1, result2, result3}
}
func (fake *FakeArchiveIndex) Add(name string, fingerprint string, path string, sha1 string) (string, string, error) {
fake.addMutex.Lock()
ret, specificReturn := fake.addReturnsOnCall[len(fake.addArgsForCall)]
fake.addArgsForCall = append(fake.addArgsForCall, struct {
name string
fingerprint string
path string
sha1 string
}{name, fingerprint, path, sha1})
fake.recordInvocation("Add", []interface{}{name, fingerprint, path, sha1})
fake.addMutex.Unlock()
if fake.AddStub != nil {
return fake.AddStub(name, fingerprint, path, sha1)
}
if specificReturn {
return ret.result1, ret.result2, ret.result3
}
return fake.addReturns.result1, fake.addReturns.result2, fake.addReturns.result3
}
func (fake *FakeArchiveIndex) AddCallCount() int {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return len(fake.addArgsForCall)
}
func (fake *FakeArchiveIndex) AddArgsForCall(i int) (string, string, string, string) {
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
return fake.addArgsForCall[i].name, fake.addArgsForCall[i].fingerprint, fake.addArgsForCall[i].path, fake.addArgsForCall[i].sha1
}
func (fake *FakeArchiveIndex) AddReturns(result1 string, result2 string, result3 error) {
fake.AddStub = nil
fake.addReturns = struct {
result1 string
result2 string
result3 error
}{result1, result2, result3}
}
func (fake *FakeArchiveIndex) AddReturnsOnCall(i int, result1 string, result2 string, result3 error) {
fake.AddStub = nil
if fake.addReturnsOnCall == nil {
fake.addReturnsOnCall = make(map[int]struct {
result1 string
result2 string
result3 error
})
}
fake.addReturnsOnCall[i] = struct {
result1 string
result2 string
result3 error
}{result1, result2, result3}
}
func (fake *FakeArchiveIndex) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.findMutex.RLock()
defer fake.findMutex.RUnlock()
fake.addMutex.RLock()
defer fake.addMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeArchiveIndex) 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 _ resource.ArchiveIndex = new(FakeArchiveIndex)