forked from pivotal-cf/on-demand-service-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_manifest_secrets_manager.go
208 lines (190 loc) · 7.13 KB
/
fake_manifest_secrets_manager.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
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"log"
"sync"
"github.com/amansingh066/on-demand-service-broker/boshdirector"
"github.com/amansingh066/on-demand-service-broker/broker"
)
type FakeManifestSecretManager struct {
DeleteSecretsForInstanceStub func(string, *log.Logger) error
deleteSecretsForInstanceMutex sync.RWMutex
deleteSecretsForInstanceArgsForCall []struct {
arg1 string
arg2 *log.Logger
}
deleteSecretsForInstanceReturns struct {
result1 error
}
deleteSecretsForInstanceReturnsOnCall map[int]struct {
result1 error
}
ResolveManifestSecretsStub func([]byte, []boshdirector.Variable, *log.Logger) (map[string]string, error)
resolveManifestSecretsMutex sync.RWMutex
resolveManifestSecretsArgsForCall []struct {
arg1 []byte
arg2 []boshdirector.Variable
arg3 *log.Logger
}
resolveManifestSecretsReturns struct {
result1 map[string]string
result2 error
}
resolveManifestSecretsReturnsOnCall map[int]struct {
result1 map[string]string
result2 error
}
invocations map[string][][]interface{}
invocationsMutex sync.RWMutex
}
func (fake *FakeManifestSecretManager) DeleteSecretsForInstance(arg1 string, arg2 *log.Logger) error {
fake.deleteSecretsForInstanceMutex.Lock()
ret, specificReturn := fake.deleteSecretsForInstanceReturnsOnCall[len(fake.deleteSecretsForInstanceArgsForCall)]
fake.deleteSecretsForInstanceArgsForCall = append(fake.deleteSecretsForInstanceArgsForCall, struct {
arg1 string
arg2 *log.Logger
}{arg1, arg2})
stub := fake.DeleteSecretsForInstanceStub
fakeReturns := fake.deleteSecretsForInstanceReturns
fake.recordInvocation("DeleteSecretsForInstance", []interface{}{arg1, arg2})
fake.deleteSecretsForInstanceMutex.Unlock()
if stub != nil {
return stub(arg1, arg2)
}
if specificReturn {
return ret.result1
}
return fakeReturns.result1
}
func (fake *FakeManifestSecretManager) DeleteSecretsForInstanceCallCount() int {
fake.deleteSecretsForInstanceMutex.RLock()
defer fake.deleteSecretsForInstanceMutex.RUnlock()
return len(fake.deleteSecretsForInstanceArgsForCall)
}
func (fake *FakeManifestSecretManager) DeleteSecretsForInstanceCalls(stub func(string, *log.Logger) error) {
fake.deleteSecretsForInstanceMutex.Lock()
defer fake.deleteSecretsForInstanceMutex.Unlock()
fake.DeleteSecretsForInstanceStub = stub
}
func (fake *FakeManifestSecretManager) DeleteSecretsForInstanceArgsForCall(i int) (string, *log.Logger) {
fake.deleteSecretsForInstanceMutex.RLock()
defer fake.deleteSecretsForInstanceMutex.RUnlock()
argsForCall := fake.deleteSecretsForInstanceArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2
}
func (fake *FakeManifestSecretManager) DeleteSecretsForInstanceReturns(result1 error) {
fake.deleteSecretsForInstanceMutex.Lock()
defer fake.deleteSecretsForInstanceMutex.Unlock()
fake.DeleteSecretsForInstanceStub = nil
fake.deleteSecretsForInstanceReturns = struct {
result1 error
}{result1}
}
func (fake *FakeManifestSecretManager) DeleteSecretsForInstanceReturnsOnCall(i int, result1 error) {
fake.deleteSecretsForInstanceMutex.Lock()
defer fake.deleteSecretsForInstanceMutex.Unlock()
fake.DeleteSecretsForInstanceStub = nil
if fake.deleteSecretsForInstanceReturnsOnCall == nil {
fake.deleteSecretsForInstanceReturnsOnCall = make(map[int]struct {
result1 error
})
}
fake.deleteSecretsForInstanceReturnsOnCall[i] = struct {
result1 error
}{result1}
}
func (fake *FakeManifestSecretManager) ResolveManifestSecrets(arg1 []byte, arg2 []boshdirector.Variable, arg3 *log.Logger) (map[string]string, error) {
var arg1Copy []byte
if arg1 != nil {
arg1Copy = make([]byte, len(arg1))
copy(arg1Copy, arg1)
}
var arg2Copy []boshdirector.Variable
if arg2 != nil {
arg2Copy = make([]boshdirector.Variable, len(arg2))
copy(arg2Copy, arg2)
}
fake.resolveManifestSecretsMutex.Lock()
ret, specificReturn := fake.resolveManifestSecretsReturnsOnCall[len(fake.resolveManifestSecretsArgsForCall)]
fake.resolveManifestSecretsArgsForCall = append(fake.resolveManifestSecretsArgsForCall, struct {
arg1 []byte
arg2 []boshdirector.Variable
arg3 *log.Logger
}{arg1Copy, arg2Copy, arg3})
stub := fake.ResolveManifestSecretsStub
fakeReturns := fake.resolveManifestSecretsReturns
fake.recordInvocation("ResolveManifestSecrets", []interface{}{arg1Copy, arg2Copy, arg3})
fake.resolveManifestSecretsMutex.Unlock()
if stub != nil {
return stub(arg1, arg2, arg3)
}
if specificReturn {
return ret.result1, ret.result2
}
return fakeReturns.result1, fakeReturns.result2
}
func (fake *FakeManifestSecretManager) ResolveManifestSecretsCallCount() int {
fake.resolveManifestSecretsMutex.RLock()
defer fake.resolveManifestSecretsMutex.RUnlock()
return len(fake.resolveManifestSecretsArgsForCall)
}
func (fake *FakeManifestSecretManager) ResolveManifestSecretsCalls(stub func([]byte, []boshdirector.Variable, *log.Logger) (map[string]string, error)) {
fake.resolveManifestSecretsMutex.Lock()
defer fake.resolveManifestSecretsMutex.Unlock()
fake.ResolveManifestSecretsStub = stub
}
func (fake *FakeManifestSecretManager) ResolveManifestSecretsArgsForCall(i int) ([]byte, []boshdirector.Variable, *log.Logger) {
fake.resolveManifestSecretsMutex.RLock()
defer fake.resolveManifestSecretsMutex.RUnlock()
argsForCall := fake.resolveManifestSecretsArgsForCall[i]
return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}
func (fake *FakeManifestSecretManager) ResolveManifestSecretsReturns(result1 map[string]string, result2 error) {
fake.resolveManifestSecretsMutex.Lock()
defer fake.resolveManifestSecretsMutex.Unlock()
fake.ResolveManifestSecretsStub = nil
fake.resolveManifestSecretsReturns = struct {
result1 map[string]string
result2 error
}{result1, result2}
}
func (fake *FakeManifestSecretManager) ResolveManifestSecretsReturnsOnCall(i int, result1 map[string]string, result2 error) {
fake.resolveManifestSecretsMutex.Lock()
defer fake.resolveManifestSecretsMutex.Unlock()
fake.ResolveManifestSecretsStub = nil
if fake.resolveManifestSecretsReturnsOnCall == nil {
fake.resolveManifestSecretsReturnsOnCall = make(map[int]struct {
result1 map[string]string
result2 error
})
}
fake.resolveManifestSecretsReturnsOnCall[i] = struct {
result1 map[string]string
result2 error
}{result1, result2}
}
func (fake *FakeManifestSecretManager) Invocations() map[string][][]interface{} {
fake.invocationsMutex.RLock()
defer fake.invocationsMutex.RUnlock()
fake.deleteSecretsForInstanceMutex.RLock()
defer fake.deleteSecretsForInstanceMutex.RUnlock()
fake.resolveManifestSecretsMutex.RLock()
defer fake.resolveManifestSecretsMutex.RUnlock()
copiedInvocations := map[string][][]interface{}{}
for key, value := range fake.invocations {
copiedInvocations[key] = value
}
return copiedInvocations
}
func (fake *FakeManifestSecretManager) 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 _ broker.ManifestSecretManager = new(FakeManifestSecretManager)