/
mock_libraries_interface.go
518 lines (422 loc) · 17.9 KB
/
mock_libraries_interface.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
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
// Code generated by mockery v2.39.1. DO NOT EDIT.
package compute
import (
context "context"
compute "github.com/databricks/databricks-sdk-go/service/compute"
listing "github.com/databricks/databricks-sdk-go/listing"
mock "github.com/stretchr/testify/mock"
retries "github.com/databricks/databricks-sdk-go/retries"
)
// MockLibrariesInterface is an autogenerated mock type for the LibrariesInterface type
type MockLibrariesInterface struct {
mock.Mock
}
type MockLibrariesInterface_Expecter struct {
mock *mock.Mock
}
func (_m *MockLibrariesInterface) EXPECT() *MockLibrariesInterface_Expecter {
return &MockLibrariesInterface_Expecter{mock: &_m.Mock}
}
// AllClusterStatuses provides a mock function with given fields: ctx
func (_m *MockLibrariesInterface) AllClusterStatuses(ctx context.Context) (*compute.ListAllClusterLibraryStatusesResponse, error) {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for AllClusterStatuses")
}
var r0 *compute.ListAllClusterLibraryStatusesResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context) (*compute.ListAllClusterLibraryStatusesResponse, error)); ok {
return rf(ctx)
}
if rf, ok := ret.Get(0).(func(context.Context) *compute.ListAllClusterLibraryStatusesResponse); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*compute.ListAllClusterLibraryStatusesResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockLibrariesInterface_AllClusterStatuses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllClusterStatuses'
type MockLibrariesInterface_AllClusterStatuses_Call struct {
*mock.Call
}
// AllClusterStatuses is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockLibrariesInterface_Expecter) AllClusterStatuses(ctx interface{}) *MockLibrariesInterface_AllClusterStatuses_Call {
return &MockLibrariesInterface_AllClusterStatuses_Call{Call: _e.mock.On("AllClusterStatuses", ctx)}
}
func (_c *MockLibrariesInterface_AllClusterStatuses_Call) Run(run func(ctx context.Context)) *MockLibrariesInterface_AllClusterStatuses_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *MockLibrariesInterface_AllClusterStatuses_Call) Return(_a0 *compute.ListAllClusterLibraryStatusesResponse, _a1 error) *MockLibrariesInterface_AllClusterStatuses_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockLibrariesInterface_AllClusterStatuses_Call) RunAndReturn(run func(context.Context) (*compute.ListAllClusterLibraryStatusesResponse, error)) *MockLibrariesInterface_AllClusterStatuses_Call {
_c.Call.Return(run)
return _c
}
// ClusterStatus provides a mock function with given fields: ctx, request
func (_m *MockLibrariesInterface) ClusterStatus(ctx context.Context, request compute.ClusterStatus) listing.Iterator[compute.LibraryFullStatus] {
ret := _m.Called(ctx, request)
if len(ret) == 0 {
panic("no return value specified for ClusterStatus")
}
var r0 listing.Iterator[compute.LibraryFullStatus]
if rf, ok := ret.Get(0).(func(context.Context, compute.ClusterStatus) listing.Iterator[compute.LibraryFullStatus]); ok {
r0 = rf(ctx, request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(listing.Iterator[compute.LibraryFullStatus])
}
}
return r0
}
// MockLibrariesInterface_ClusterStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClusterStatus'
type MockLibrariesInterface_ClusterStatus_Call struct {
*mock.Call
}
// ClusterStatus is a helper method to define mock.On call
// - ctx context.Context
// - request compute.ClusterStatus
func (_e *MockLibrariesInterface_Expecter) ClusterStatus(ctx interface{}, request interface{}) *MockLibrariesInterface_ClusterStatus_Call {
return &MockLibrariesInterface_ClusterStatus_Call{Call: _e.mock.On("ClusterStatus", ctx, request)}
}
func (_c *MockLibrariesInterface_ClusterStatus_Call) Run(run func(ctx context.Context, request compute.ClusterStatus)) *MockLibrariesInterface_ClusterStatus_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(compute.ClusterStatus))
})
return _c
}
func (_c *MockLibrariesInterface_ClusterStatus_Call) Return(_a0 listing.Iterator[compute.LibraryFullStatus]) *MockLibrariesInterface_ClusterStatus_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLibrariesInterface_ClusterStatus_Call) RunAndReturn(run func(context.Context, compute.ClusterStatus) listing.Iterator[compute.LibraryFullStatus]) *MockLibrariesInterface_ClusterStatus_Call {
_c.Call.Return(run)
return _c
}
// ClusterStatusAll provides a mock function with given fields: ctx, request
func (_m *MockLibrariesInterface) ClusterStatusAll(ctx context.Context, request compute.ClusterStatus) ([]compute.LibraryFullStatus, error) {
ret := _m.Called(ctx, request)
if len(ret) == 0 {
panic("no return value specified for ClusterStatusAll")
}
var r0 []compute.LibraryFullStatus
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, compute.ClusterStatus) ([]compute.LibraryFullStatus, error)); ok {
return rf(ctx, request)
}
if rf, ok := ret.Get(0).(func(context.Context, compute.ClusterStatus) []compute.LibraryFullStatus); ok {
r0 = rf(ctx, request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]compute.LibraryFullStatus)
}
}
if rf, ok := ret.Get(1).(func(context.Context, compute.ClusterStatus) error); ok {
r1 = rf(ctx, request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockLibrariesInterface_ClusterStatusAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClusterStatusAll'
type MockLibrariesInterface_ClusterStatusAll_Call struct {
*mock.Call
}
// ClusterStatusAll is a helper method to define mock.On call
// - ctx context.Context
// - request compute.ClusterStatus
func (_e *MockLibrariesInterface_Expecter) ClusterStatusAll(ctx interface{}, request interface{}) *MockLibrariesInterface_ClusterStatusAll_Call {
return &MockLibrariesInterface_ClusterStatusAll_Call{Call: _e.mock.On("ClusterStatusAll", ctx, request)}
}
func (_c *MockLibrariesInterface_ClusterStatusAll_Call) Run(run func(ctx context.Context, request compute.ClusterStatus)) *MockLibrariesInterface_ClusterStatusAll_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(compute.ClusterStatus))
})
return _c
}
func (_c *MockLibrariesInterface_ClusterStatusAll_Call) Return(_a0 []compute.LibraryFullStatus, _a1 error) *MockLibrariesInterface_ClusterStatusAll_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockLibrariesInterface_ClusterStatusAll_Call) RunAndReturn(run func(context.Context, compute.ClusterStatus) ([]compute.LibraryFullStatus, error)) *MockLibrariesInterface_ClusterStatusAll_Call {
_c.Call.Return(run)
return _c
}
// ClusterStatusByClusterId provides a mock function with given fields: ctx, clusterId
func (_m *MockLibrariesInterface) ClusterStatusByClusterId(ctx context.Context, clusterId string) (*compute.ClusterStatusResponse, error) {
ret := _m.Called(ctx, clusterId)
if len(ret) == 0 {
panic("no return value specified for ClusterStatusByClusterId")
}
var r0 *compute.ClusterStatusResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (*compute.ClusterStatusResponse, error)); ok {
return rf(ctx, clusterId)
}
if rf, ok := ret.Get(0).(func(context.Context, string) *compute.ClusterStatusResponse); ok {
r0 = rf(ctx, clusterId)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*compute.ClusterStatusResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, clusterId)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockLibrariesInterface_ClusterStatusByClusterId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ClusterStatusByClusterId'
type MockLibrariesInterface_ClusterStatusByClusterId_Call struct {
*mock.Call
}
// ClusterStatusByClusterId is a helper method to define mock.On call
// - ctx context.Context
// - clusterId string
func (_e *MockLibrariesInterface_Expecter) ClusterStatusByClusterId(ctx interface{}, clusterId interface{}) *MockLibrariesInterface_ClusterStatusByClusterId_Call {
return &MockLibrariesInterface_ClusterStatusByClusterId_Call{Call: _e.mock.On("ClusterStatusByClusterId", ctx, clusterId)}
}
func (_c *MockLibrariesInterface_ClusterStatusByClusterId_Call) Run(run func(ctx context.Context, clusterId string)) *MockLibrariesInterface_ClusterStatusByClusterId_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *MockLibrariesInterface_ClusterStatusByClusterId_Call) Return(_a0 *compute.ClusterStatusResponse, _a1 error) *MockLibrariesInterface_ClusterStatusByClusterId_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *MockLibrariesInterface_ClusterStatusByClusterId_Call) RunAndReturn(run func(context.Context, string) (*compute.ClusterStatusResponse, error)) *MockLibrariesInterface_ClusterStatusByClusterId_Call {
_c.Call.Return(run)
return _c
}
// Impl provides a mock function with given fields:
func (_m *MockLibrariesInterface) Impl() compute.LibrariesService {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Impl")
}
var r0 compute.LibrariesService
if rf, ok := ret.Get(0).(func() compute.LibrariesService); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(compute.LibrariesService)
}
}
return r0
}
// MockLibrariesInterface_Impl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Impl'
type MockLibrariesInterface_Impl_Call struct {
*mock.Call
}
// Impl is a helper method to define mock.On call
func (_e *MockLibrariesInterface_Expecter) Impl() *MockLibrariesInterface_Impl_Call {
return &MockLibrariesInterface_Impl_Call{Call: _e.mock.On("Impl")}
}
func (_c *MockLibrariesInterface_Impl_Call) Run(run func()) *MockLibrariesInterface_Impl_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockLibrariesInterface_Impl_Call) Return(_a0 compute.LibrariesService) *MockLibrariesInterface_Impl_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLibrariesInterface_Impl_Call) RunAndReturn(run func() compute.LibrariesService) *MockLibrariesInterface_Impl_Call {
_c.Call.Return(run)
return _c
}
// Install provides a mock function with given fields: ctx, request
func (_m *MockLibrariesInterface) Install(ctx context.Context, request compute.InstallLibraries) error {
ret := _m.Called(ctx, request)
if len(ret) == 0 {
panic("no return value specified for Install")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, compute.InstallLibraries) error); ok {
r0 = rf(ctx, request)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockLibrariesInterface_Install_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Install'
type MockLibrariesInterface_Install_Call struct {
*mock.Call
}
// Install is a helper method to define mock.On call
// - ctx context.Context
// - request compute.InstallLibraries
func (_e *MockLibrariesInterface_Expecter) Install(ctx interface{}, request interface{}) *MockLibrariesInterface_Install_Call {
return &MockLibrariesInterface_Install_Call{Call: _e.mock.On("Install", ctx, request)}
}
func (_c *MockLibrariesInterface_Install_Call) Run(run func(ctx context.Context, request compute.InstallLibraries)) *MockLibrariesInterface_Install_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(compute.InstallLibraries))
})
return _c
}
func (_c *MockLibrariesInterface_Install_Call) Return(_a0 error) *MockLibrariesInterface_Install_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLibrariesInterface_Install_Call) RunAndReturn(run func(context.Context, compute.InstallLibraries) error) *MockLibrariesInterface_Install_Call {
_c.Call.Return(run)
return _c
}
// Uninstall provides a mock function with given fields: ctx, request
func (_m *MockLibrariesInterface) Uninstall(ctx context.Context, request compute.UninstallLibraries) error {
ret := _m.Called(ctx, request)
if len(ret) == 0 {
panic("no return value specified for Uninstall")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, compute.UninstallLibraries) error); ok {
r0 = rf(ctx, request)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockLibrariesInterface_Uninstall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Uninstall'
type MockLibrariesInterface_Uninstall_Call struct {
*mock.Call
}
// Uninstall is a helper method to define mock.On call
// - ctx context.Context
// - request compute.UninstallLibraries
func (_e *MockLibrariesInterface_Expecter) Uninstall(ctx interface{}, request interface{}) *MockLibrariesInterface_Uninstall_Call {
return &MockLibrariesInterface_Uninstall_Call{Call: _e.mock.On("Uninstall", ctx, request)}
}
func (_c *MockLibrariesInterface_Uninstall_Call) Run(run func(ctx context.Context, request compute.UninstallLibraries)) *MockLibrariesInterface_Uninstall_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(compute.UninstallLibraries))
})
return _c
}
func (_c *MockLibrariesInterface_Uninstall_Call) Return(_a0 error) *MockLibrariesInterface_Uninstall_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLibrariesInterface_Uninstall_Call) RunAndReturn(run func(context.Context, compute.UninstallLibraries) error) *MockLibrariesInterface_Uninstall_Call {
_c.Call.Return(run)
return _c
}
// UpdateAndWait provides a mock function with given fields: ctx, update, options
func (_m *MockLibrariesInterface) UpdateAndWait(ctx context.Context, update compute.Update, options ...retries.Option[compute.ClusterStatusResponse]) error {
_va := make([]interface{}, len(options))
for _i := range options {
_va[_i] = options[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, update)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for UpdateAndWait")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, compute.Update, ...retries.Option[compute.ClusterStatusResponse]) error); ok {
r0 = rf(ctx, update, options...)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockLibrariesInterface_UpdateAndWait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAndWait'
type MockLibrariesInterface_UpdateAndWait_Call struct {
*mock.Call
}
// UpdateAndWait is a helper method to define mock.On call
// - ctx context.Context
// - update compute.Update
// - options ...retries.Option[compute.ClusterStatusResponse]
func (_e *MockLibrariesInterface_Expecter) UpdateAndWait(ctx interface{}, update interface{}, options ...interface{}) *MockLibrariesInterface_UpdateAndWait_Call {
return &MockLibrariesInterface_UpdateAndWait_Call{Call: _e.mock.On("UpdateAndWait",
append([]interface{}{ctx, update}, options...)...)}
}
func (_c *MockLibrariesInterface_UpdateAndWait_Call) Run(run func(ctx context.Context, update compute.Update, options ...retries.Option[compute.ClusterStatusResponse])) *MockLibrariesInterface_UpdateAndWait_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]retries.Option[compute.ClusterStatusResponse], len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(retries.Option[compute.ClusterStatusResponse])
}
}
run(args[0].(context.Context), args[1].(compute.Update), variadicArgs...)
})
return _c
}
func (_c *MockLibrariesInterface_UpdateAndWait_Call) Return(_a0 error) *MockLibrariesInterface_UpdateAndWait_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLibrariesInterface_UpdateAndWait_Call) RunAndReturn(run func(context.Context, compute.Update, ...retries.Option[compute.ClusterStatusResponse]) error) *MockLibrariesInterface_UpdateAndWait_Call {
_c.Call.Return(run)
return _c
}
// WithImpl provides a mock function with given fields: impl
func (_m *MockLibrariesInterface) WithImpl(impl compute.LibrariesService) compute.LibrariesInterface {
ret := _m.Called(impl)
if len(ret) == 0 {
panic("no return value specified for WithImpl")
}
var r0 compute.LibrariesInterface
if rf, ok := ret.Get(0).(func(compute.LibrariesService) compute.LibrariesInterface); ok {
r0 = rf(impl)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(compute.LibrariesInterface)
}
}
return r0
}
// MockLibrariesInterface_WithImpl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WithImpl'
type MockLibrariesInterface_WithImpl_Call struct {
*mock.Call
}
// WithImpl is a helper method to define mock.On call
// - impl compute.LibrariesService
func (_e *MockLibrariesInterface_Expecter) WithImpl(impl interface{}) *MockLibrariesInterface_WithImpl_Call {
return &MockLibrariesInterface_WithImpl_Call{Call: _e.mock.On("WithImpl", impl)}
}
func (_c *MockLibrariesInterface_WithImpl_Call) Run(run func(impl compute.LibrariesService)) *MockLibrariesInterface_WithImpl_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(compute.LibrariesService))
})
return _c
}
func (_c *MockLibrariesInterface_WithImpl_Call) Return(_a0 compute.LibrariesInterface) *MockLibrariesInterface_WithImpl_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *MockLibrariesInterface_WithImpl_Call) RunAndReturn(run func(compute.LibrariesService) compute.LibrariesInterface) *MockLibrariesInterface_WithImpl_Call {
_c.Call.Return(run)
return _c
}
// NewMockLibrariesInterface creates a new instance of MockLibrariesInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMockLibrariesInterface(t interface {
mock.TestingT
Cleanup(func())
}) *MockLibrariesInterface {
mock := &MockLibrariesInterface{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}