forked from hashicorp/consul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_Provider.go
437 lines (357 loc) · 11.3 KB
/
mock_Provider.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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
// Code generated by mockery v2.20.0. DO NOT EDIT.
package scada
import (
net "net"
mock "github.com/stretchr/testify/mock"
provider "github.com/hashicorp/hcp-scada-provider"
time "time"
)
// MockProvider is an autogenerated mock type for the Provider type
type MockProvider struct {
mock.Mock
}
type MockProvider_Expecter struct {
mock *mock.Mock
}
func (_m *MockProvider) EXPECT() *MockProvider_Expecter {
return &MockProvider_Expecter{mock: &_m.Mock}
}
// AddMeta provides a mock function with given fields: _a0
func (_m *MockProvider) AddMeta(_a0 ...provider.Meta) {
_va := make([]interface{}, len(_a0))
for _i := range _a0 {
_va[_i] = _a0[_i]
}
var _ca []interface{}
_ca = append(_ca, _va...)
_m.Called(_ca...)
}
// MockProvider_AddMeta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddMeta'
type MockProvider_AddMeta_Call struct {
*mock.Call
}
// AddMeta is a helper method to define mock.On call
// - _a0 ...provider.Meta
func (_e *MockProvider_Expecter) AddMeta(_a0 ...interface{}) *MockProvider_AddMeta_Call {
return &MockProvider_AddMeta_Call{Call: _e.mock.On("AddMeta",
append([]interface{}{}, _a0...)...)}
}
func (_c *MockProvider_AddMeta_Call) Run(run func(_a0 ...provider.Meta)) *MockProvider_AddMeta_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]provider.Meta, len(args)-0)
for i, a := range args[0:] {
if a != nil {
variadicArgs[i] = a.(provider.Meta)
}
}
run(variadicArgs...)
})
return _c
}
func (_c *MockProvider_AddMeta_Call) Return() *MockProvider_AddMeta_Call {
_c.Call.Return()
return _c
}
func (_c *MockProvider_AddMeta_Call) RunAndReturn(run func(...provider.Meta)) *MockProvider_AddMeta_Call {
_c.Call.Return(run)
return _c
}
// DeleteMeta provides a mock function with given fields: _a0
func (_m *MockProvider) DeleteMeta(_a0 ...string) {
_va := make([]interface{}, len(_a0))
for _i := range _a0 {
_va[_i] = _a0[_i]
}
var _ca []interface{}
_ca = append(_ca, _va...)
_m.Called(_ca...)
}
// MockProvider_DeleteMeta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteMeta'
type MockProvider_DeleteMeta_Call struct {
*mock.Call
}
// DeleteMeta is a helper method to define mock.On call
// - _a0 ...string
func (_e *MockProvider_Expecter) DeleteMeta(_a0 ...interface{}) *MockProvider_DeleteMeta_Call {
return &MockProvider_DeleteMeta_Call{Call: _e.mock.On("DeleteMeta",
append([]interface{}{}, _a0...)...)}
}
func (_c *MockProvider_DeleteMeta_Call) Run(run func(_a0 ...string)) *MockProvider_DeleteMeta_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]string, len(args)-0)
for i, a := range args[0:] {
if a != nil {
variadicArgs[i] = a.(string)
}
}
run(variadicArgs...)
})
return _c
}
func (_c *MockProvider_DeleteMeta_Call) Return() *MockProvider_DeleteMeta_Call {
_c.Call.Return()
return _c
}
func (_c *MockProvider_DeleteMeta_Call) RunAndReturn(run func(...string)) *MockProvider_DeleteMeta_Call {
_c.Call.Return(run)
return _c
}
// GetMeta provides a mock function with given fields:
func (_m *MockProvider) GetMeta() map[string]string {
ret := _m.Called()
var r0 map[string]string
if rf, ok := ret.Get(0).(func() map[string]string); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]string)
}
}
return r0
}
// MockProvider_GetMeta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMeta'
type MockProvider_GetMeta_Call struct {
*mock.Call
}
// GetMeta is a helper method to define mock.On call
func (_e *MockProvider_Expecter) GetMeta() *MockProvider_GetMeta_Call {
return &MockProvider_GetMeta_Call{Call: _e.mock.On("GetMeta")}
}
func (_c *MockProvider_GetMeta_Call) Run(run func()) *MockProvider_GetMeta_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockProvider_GetMeta_Call) Return(_a0 map[string]string) *MockProvider_GetMeta_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockProvider_GetMeta_Call) RunAndReturn(run func() map[string]string) *MockProvider_GetMeta_Call {
_c.Call.Return(run)
return _c
}
// LastError provides a mock function with given fields:
func (_m *MockProvider) LastError() (time.Time, error) {
ret := _m.Called()
var r0 time.Time
var r1 error
if rf, ok := ret.Get(0).(func() (time.Time, error)); ok {
return rf()
}
if rf, ok := ret.Get(0).(func() time.Time); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(time.Time)
}
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockProvider_LastError_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastError'
type MockProvider_LastError_Call struct {
*mock.Call
}
// LastError is a helper method to define mock.On call
func (_e *MockProvider_Expecter) LastError() *MockProvider_LastError_Call {
return &MockProvider_LastError_Call{Call: _e.mock.On("LastError")}
}
func (_c *MockProvider_LastError_Call) Run(run func()) *MockProvider_LastError_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockProvider_LastError_Call) Return(_a0 time.Time, _a1 error) *MockProvider_LastError_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockProvider_LastError_Call) RunAndReturn(run func() (time.Time, error)) *MockProvider_LastError_Call {
_c.Call.Return(run)
return _c
}
// Listen provides a mock function with given fields: capability
func (_m *MockProvider) Listen(capability string) (net.Listener, error) {
ret := _m.Called(capability)
var r0 net.Listener
var r1 error
if rf, ok := ret.Get(0).(func(string) (net.Listener, error)); ok {
return rf(capability)
}
if rf, ok := ret.Get(0).(func(string) net.Listener); ok {
r0 = rf(capability)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(net.Listener)
}
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(capability)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockProvider_Listen_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Listen'
type MockProvider_Listen_Call struct {
*mock.Call
}
// Listen is a helper method to define mock.On call
// - capability string
func (_e *MockProvider_Expecter) Listen(capability interface{}) *MockProvider_Listen_Call {
return &MockProvider_Listen_Call{Call: _e.mock.On("Listen", capability)}
}
func (_c *MockProvider_Listen_Call) Run(run func(capability string)) *MockProvider_Listen_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(string))
})
return _c
}
func (_c *MockProvider_Listen_Call) Return(_a0 net.Listener, _a1 error) *MockProvider_Listen_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockProvider_Listen_Call) RunAndReturn(run func(string) (net.Listener, error)) *MockProvider_Listen_Call {
_c.Call.Return(run)
return _c
}
// SessionStatus provides a mock function with given fields:
func (_m *MockProvider) SessionStatus() string {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockProvider_SessionStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SessionStatus'
type MockProvider_SessionStatus_Call struct {
*mock.Call
}
// SessionStatus is a helper method to define mock.On call
func (_e *MockProvider_Expecter) SessionStatus() *MockProvider_SessionStatus_Call {
return &MockProvider_SessionStatus_Call{Call: _e.mock.On("SessionStatus")}
}
func (_c *MockProvider_SessionStatus_Call) Run(run func()) *MockProvider_SessionStatus_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockProvider_SessionStatus_Call) Return(_a0 string) *MockProvider_SessionStatus_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockProvider_SessionStatus_Call) RunAndReturn(run func() string) *MockProvider_SessionStatus_Call {
_c.Call.Return(run)
return _c
}
// Start provides a mock function with given fields:
func (_m *MockProvider) Start() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockProvider_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start'
type MockProvider_Start_Call struct {
*mock.Call
}
// Start is a helper method to define mock.On call
func (_e *MockProvider_Expecter) Start() *MockProvider_Start_Call {
return &MockProvider_Start_Call{Call: _e.mock.On("Start")}
}
func (_c *MockProvider_Start_Call) Run(run func()) *MockProvider_Start_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockProvider_Start_Call) Return(_a0 error) *MockProvider_Start_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockProvider_Start_Call) RunAndReturn(run func() error) *MockProvider_Start_Call {
_c.Call.Return(run)
return _c
}
// Stop provides a mock function with given fields:
func (_m *MockProvider) Stop() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockProvider_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop'
type MockProvider_Stop_Call struct {
*mock.Call
}
// Stop is a helper method to define mock.On call
func (_e *MockProvider_Expecter) Stop() *MockProvider_Stop_Call {
return &MockProvider_Stop_Call{Call: _e.mock.On("Stop")}
}
func (_c *MockProvider_Stop_Call) Run(run func()) *MockProvider_Stop_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockProvider_Stop_Call) Return(_a0 error) *MockProvider_Stop_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockProvider_Stop_Call) RunAndReturn(run func() error) *MockProvider_Stop_Call {
_c.Call.Return(run)
return _c
}
// UpdateMeta provides a mock function with given fields: _a0
func (_m *MockProvider) UpdateMeta(_a0 map[string]string) {
_m.Called(_a0)
}
// MockProvider_UpdateMeta_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateMeta'
type MockProvider_UpdateMeta_Call struct {
*mock.Call
}
// UpdateMeta is a helper method to define mock.On call
// - _a0 map[string]string
func (_e *MockProvider_Expecter) UpdateMeta(_a0 interface{}) *MockProvider_UpdateMeta_Call {
return &MockProvider_UpdateMeta_Call{Call: _e.mock.On("UpdateMeta", _a0)}
}
func (_c *MockProvider_UpdateMeta_Call) Run(run func(_a0 map[string]string)) *MockProvider_UpdateMeta_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(map[string]string))
})
return _c
}
func (_c *MockProvider_UpdateMeta_Call) Return() *MockProvider_UpdateMeta_Call {
_c.Call.Return()
return _c
}
func (_c *MockProvider_UpdateMeta_Call) RunAndReturn(run func(map[string]string)) *MockProvider_UpdateMeta_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewMockProvider interface {
mock.TestingT
Cleanup(func())
}
// NewMockProvider creates a new instance of MockProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewMockProvider(t mockConstructorTestingTNewMockProvider) *MockProvider {
mock := &MockProvider{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}