forked from raystack/compass
/
asset_service.go
734 lines (607 loc) · 24.2 KB
/
asset_service.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
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
// Code generated by mockery v2.26.1. DO NOT EDIT.
package mocks
import (
context "context"
asset "github.com/goto/compass/core/asset"
mock "github.com/stretchr/testify/mock"
)
// AssetService is an autogenerated mock type for the AssetService type
type AssetService struct {
mock.Mock
}
type AssetService_Expecter struct {
mock *mock.Mock
}
func (_m *AssetService) EXPECT() *AssetService_Expecter {
return &AssetService_Expecter{mock: &_m.Mock}
}
// AddProbe provides a mock function with given fields: ctx, assetURN, probe
func (_m *AssetService) AddProbe(ctx context.Context, assetURN string, probe *asset.Probe) error {
ret := _m.Called(ctx, assetURN, probe)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string, *asset.Probe) error); ok {
r0 = rf(ctx, assetURN, probe)
} else {
r0 = ret.Error(0)
}
return r0
}
// AssetService_AddProbe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddProbe'
type AssetService_AddProbe_Call struct {
*mock.Call
}
// AddProbe is a helper method to define mock.On call
// - ctx context.Context
// - assetURN string
// - probe *asset.Probe
func (_e *AssetService_Expecter) AddProbe(ctx interface{}, assetURN interface{}, probe interface{}) *AssetService_AddProbe_Call {
return &AssetService_AddProbe_Call{Call: _e.mock.On("AddProbe", ctx, assetURN, probe)}
}
func (_c *AssetService_AddProbe_Call) Run(run func(ctx context.Context, assetURN string, probe *asset.Probe)) *AssetService_AddProbe_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(*asset.Probe))
})
return _c
}
func (_c *AssetService_AddProbe_Call) Return(_a0 error) *AssetService_AddProbe_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *AssetService_AddProbe_Call) RunAndReturn(run func(context.Context, string, *asset.Probe) error) *AssetService_AddProbe_Call {
_c.Call.Return(run)
return _c
}
// DeleteAsset provides a mock function with given fields: ctx, id
func (_m *AssetService) DeleteAsset(ctx context.Context, id string) error {
ret := _m.Called(ctx, id)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Error(0)
}
return r0
}
// AssetService_DeleteAsset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAsset'
type AssetService_DeleteAsset_Call struct {
*mock.Call
}
// DeleteAsset is a helper method to define mock.On call
// - ctx context.Context
// - id string
func (_e *AssetService_Expecter) DeleteAsset(ctx interface{}, id interface{}) *AssetService_DeleteAsset_Call {
return &AssetService_DeleteAsset_Call{Call: _e.mock.On("DeleteAsset", ctx, id)}
}
func (_c *AssetService_DeleteAsset_Call) Run(run func(ctx context.Context, id string)) *AssetService_DeleteAsset_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *AssetService_DeleteAsset_Call) Return(_a0 error) *AssetService_DeleteAsset_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *AssetService_DeleteAsset_Call) RunAndReturn(run func(context.Context, string) error) *AssetService_DeleteAsset_Call {
_c.Call.Return(run)
return _c
}
// GetAllAssets provides a mock function with given fields: ctx, flt, withTotal
func (_m *AssetService) GetAllAssets(ctx context.Context, flt asset.Filter, withTotal bool) ([]asset.Asset, uint32, error) {
ret := _m.Called(ctx, flt, withTotal)
var r0 []asset.Asset
var r1 uint32
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, asset.Filter, bool) ([]asset.Asset, uint32, error)); ok {
return rf(ctx, flt, withTotal)
}
if rf, ok := ret.Get(0).(func(context.Context, asset.Filter, bool) []asset.Asset); ok {
r0 = rf(ctx, flt, withTotal)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]asset.Asset)
}
}
if rf, ok := ret.Get(1).(func(context.Context, asset.Filter, bool) uint32); ok {
r1 = rf(ctx, flt, withTotal)
} else {
r1 = ret.Get(1).(uint32)
}
if rf, ok := ret.Get(2).(func(context.Context, asset.Filter, bool) error); ok {
r2 = rf(ctx, flt, withTotal)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// AssetService_GetAllAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllAssets'
type AssetService_GetAllAssets_Call struct {
*mock.Call
}
// GetAllAssets is a helper method to define mock.On call
// - ctx context.Context
// - flt asset.Filter
// - withTotal bool
func (_e *AssetService_Expecter) GetAllAssets(ctx interface{}, flt interface{}, withTotal interface{}) *AssetService_GetAllAssets_Call {
return &AssetService_GetAllAssets_Call{Call: _e.mock.On("GetAllAssets", ctx, flt, withTotal)}
}
func (_c *AssetService_GetAllAssets_Call) Run(run func(ctx context.Context, flt asset.Filter, withTotal bool)) *AssetService_GetAllAssets_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(asset.Filter), args[2].(bool))
})
return _c
}
func (_c *AssetService_GetAllAssets_Call) Return(_a0 []asset.Asset, _a1 uint32, _a2 error) *AssetService_GetAllAssets_Call {
_c.Call.Return(_a0, _a1, _a2)
return _c
}
func (_c *AssetService_GetAllAssets_Call) RunAndReturn(run func(context.Context, asset.Filter, bool) ([]asset.Asset, uint32, error)) *AssetService_GetAllAssets_Call {
_c.Call.Return(run)
return _c
}
// GetAssetByID provides a mock function with given fields: ctx, id
func (_m *AssetService) GetAssetByID(ctx context.Context, id string) (asset.Asset, error) {
ret := _m.Called(ctx, id)
var r0 asset.Asset
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (asset.Asset, error)); ok {
return rf(ctx, id)
}
if rf, ok := ret.Get(0).(func(context.Context, string) asset.Asset); ok {
r0 = rf(ctx, id)
} else {
r0 = ret.Get(0).(asset.Asset)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_GetAssetByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAssetByID'
type AssetService_GetAssetByID_Call struct {
*mock.Call
}
// GetAssetByID is a helper method to define mock.On call
// - ctx context.Context
// - id string
func (_e *AssetService_Expecter) GetAssetByID(ctx interface{}, id interface{}) *AssetService_GetAssetByID_Call {
return &AssetService_GetAssetByID_Call{Call: _e.mock.On("GetAssetByID", ctx, id)}
}
func (_c *AssetService_GetAssetByID_Call) Run(run func(ctx context.Context, id string)) *AssetService_GetAssetByID_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string))
})
return _c
}
func (_c *AssetService_GetAssetByID_Call) Return(_a0 asset.Asset, _a1 error) *AssetService_GetAssetByID_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AssetService_GetAssetByID_Call) RunAndReturn(run func(context.Context, string) (asset.Asset, error)) *AssetService_GetAssetByID_Call {
_c.Call.Return(run)
return _c
}
// GetAssetByVersion provides a mock function with given fields: ctx, id, version
func (_m *AssetService) GetAssetByVersion(ctx context.Context, id string, version string) (asset.Asset, error) {
ret := _m.Called(ctx, id, version)
var r0 asset.Asset
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (asset.Asset, error)); ok {
return rf(ctx, id, version)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) asset.Asset); ok {
r0 = rf(ctx, id, version)
} else {
r0 = ret.Get(0).(asset.Asset)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, id, version)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_GetAssetByVersion_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAssetByVersion'
type AssetService_GetAssetByVersion_Call struct {
*mock.Call
}
// GetAssetByVersion is a helper method to define mock.On call
// - ctx context.Context
// - id string
// - version string
func (_e *AssetService_Expecter) GetAssetByVersion(ctx interface{}, id interface{}, version interface{}) *AssetService_GetAssetByVersion_Call {
return &AssetService_GetAssetByVersion_Call{Call: _e.mock.On("GetAssetByVersion", ctx, id, version)}
}
func (_c *AssetService_GetAssetByVersion_Call) Run(run func(ctx context.Context, id string, version string)) *AssetService_GetAssetByVersion_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(string))
})
return _c
}
func (_c *AssetService_GetAssetByVersion_Call) Return(_a0 asset.Asset, _a1 error) *AssetService_GetAssetByVersion_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AssetService_GetAssetByVersion_Call) RunAndReturn(run func(context.Context, string, string) (asset.Asset, error)) *AssetService_GetAssetByVersion_Call {
_c.Call.Return(run)
return _c
}
// GetAssetVersionHistory provides a mock function with given fields: ctx, flt, id
func (_m *AssetService) GetAssetVersionHistory(ctx context.Context, flt asset.Filter, id string) ([]asset.Asset, error) {
ret := _m.Called(ctx, flt, id)
var r0 []asset.Asset
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, asset.Filter, string) ([]asset.Asset, error)); ok {
return rf(ctx, flt, id)
}
if rf, ok := ret.Get(0).(func(context.Context, asset.Filter, string) []asset.Asset); ok {
r0 = rf(ctx, flt, id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]asset.Asset)
}
}
if rf, ok := ret.Get(1).(func(context.Context, asset.Filter, string) error); ok {
r1 = rf(ctx, flt, id)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_GetAssetVersionHistory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAssetVersionHistory'
type AssetService_GetAssetVersionHistory_Call struct {
*mock.Call
}
// GetAssetVersionHistory is a helper method to define mock.On call
// - ctx context.Context
// - flt asset.Filter
// - id string
func (_e *AssetService_Expecter) GetAssetVersionHistory(ctx interface{}, flt interface{}, id interface{}) *AssetService_GetAssetVersionHistory_Call {
return &AssetService_GetAssetVersionHistory_Call{Call: _e.mock.On("GetAssetVersionHistory", ctx, flt, id)}
}
func (_c *AssetService_GetAssetVersionHistory_Call) Run(run func(ctx context.Context, flt asset.Filter, id string)) *AssetService_GetAssetVersionHistory_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(asset.Filter), args[2].(string))
})
return _c
}
func (_c *AssetService_GetAssetVersionHistory_Call) Return(_a0 []asset.Asset, _a1 error) *AssetService_GetAssetVersionHistory_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AssetService_GetAssetVersionHistory_Call) RunAndReturn(run func(context.Context, asset.Filter, string) ([]asset.Asset, error)) *AssetService_GetAssetVersionHistory_Call {
_c.Call.Return(run)
return _c
}
// GetLineage provides a mock function with given fields: ctx, urn, query
func (_m *AssetService) GetLineage(ctx context.Context, urn string, query asset.LineageQuery) (asset.Lineage, error) {
ret := _m.Called(ctx, urn, query)
var r0 asset.Lineage
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, asset.LineageQuery) (asset.Lineage, error)); ok {
return rf(ctx, urn, query)
}
if rf, ok := ret.Get(0).(func(context.Context, string, asset.LineageQuery) asset.Lineage); ok {
r0 = rf(ctx, urn, query)
} else {
r0 = ret.Get(0).(asset.Lineage)
}
if rf, ok := ret.Get(1).(func(context.Context, string, asset.LineageQuery) error); ok {
r1 = rf(ctx, urn, query)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_GetLineage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLineage'
type AssetService_GetLineage_Call struct {
*mock.Call
}
// GetLineage is a helper method to define mock.On call
// - ctx context.Context
// - urn string
// - query asset.LineageQuery
func (_e *AssetService_Expecter) GetLineage(ctx interface{}, urn interface{}, query interface{}) *AssetService_GetLineage_Call {
return &AssetService_GetLineage_Call{Call: _e.mock.On("GetLineage", ctx, urn, query)}
}
func (_c *AssetService_GetLineage_Call) Run(run func(ctx context.Context, urn string, query asset.LineageQuery)) *AssetService_GetLineage_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(string), args[2].(asset.LineageQuery))
})
return _c
}
func (_c *AssetService_GetLineage_Call) Return(_a0 asset.Lineage, _a1 error) *AssetService_GetLineage_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AssetService_GetLineage_Call) RunAndReturn(run func(context.Context, string, asset.LineageQuery) (asset.Lineage, error)) *AssetService_GetLineage_Call {
_c.Call.Return(run)
return _c
}
// GetTypes provides a mock function with given fields: ctx, flt
func (_m *AssetService) GetTypes(ctx context.Context, flt asset.Filter) (map[asset.Type]int, error) {
ret := _m.Called(ctx, flt)
var r0 map[asset.Type]int
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, asset.Filter) (map[asset.Type]int, error)); ok {
return rf(ctx, flt)
}
if rf, ok := ret.Get(0).(func(context.Context, asset.Filter) map[asset.Type]int); ok {
r0 = rf(ctx, flt)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[asset.Type]int)
}
}
if rf, ok := ret.Get(1).(func(context.Context, asset.Filter) error); ok {
r1 = rf(ctx, flt)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_GetTypes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTypes'
type AssetService_GetTypes_Call struct {
*mock.Call
}
// GetTypes is a helper method to define mock.On call
// - ctx context.Context
// - flt asset.Filter
func (_e *AssetService_Expecter) GetTypes(ctx interface{}, flt interface{}) *AssetService_GetTypes_Call {
return &AssetService_GetTypes_Call{Call: _e.mock.On("GetTypes", ctx, flt)}
}
func (_c *AssetService_GetTypes_Call) Run(run func(ctx context.Context, flt asset.Filter)) *AssetService_GetTypes_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(asset.Filter))
})
return _c
}
func (_c *AssetService_GetTypes_Call) Return(_a0 map[asset.Type]int, _a1 error) *AssetService_GetTypes_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AssetService_GetTypes_Call) RunAndReturn(run func(context.Context, asset.Filter) (map[asset.Type]int, error)) *AssetService_GetTypes_Call {
_c.Call.Return(run)
return _c
}
// GroupAssets provides a mock function with given fields: ctx, cfg
func (_m *AssetService) GroupAssets(ctx context.Context, cfg asset.GroupConfig) ([]asset.GroupResult, error) {
ret := _m.Called(ctx, cfg)
var r0 []asset.GroupResult
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, asset.GroupConfig) ([]asset.GroupResult, error)); ok {
return rf(ctx, cfg)
}
if rf, ok := ret.Get(0).(func(context.Context, asset.GroupConfig) []asset.GroupResult); ok {
r0 = rf(ctx, cfg)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]asset.GroupResult)
}
}
if rf, ok := ret.Get(1).(func(context.Context, asset.GroupConfig) error); ok {
r1 = rf(ctx, cfg)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_GroupAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GroupAssets'
type AssetService_GroupAssets_Call struct {
*mock.Call
}
// GroupAssets is a helper method to define mock.On call
// - ctx context.Context
// - cfg asset.GroupConfig
func (_e *AssetService_Expecter) GroupAssets(ctx interface{}, cfg interface{}) *AssetService_GroupAssets_Call {
return &AssetService_GroupAssets_Call{Call: _e.mock.On("GroupAssets", ctx, cfg)}
}
func (_c *AssetService_GroupAssets_Call) Run(run func(ctx context.Context, cfg asset.GroupConfig)) *AssetService_GroupAssets_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(asset.GroupConfig))
})
return _c
}
func (_c *AssetService_GroupAssets_Call) Return(results []asset.GroupResult, err error) *AssetService_GroupAssets_Call {
_c.Call.Return(results, err)
return _c
}
func (_c *AssetService_GroupAssets_Call) RunAndReturn(run func(context.Context, asset.GroupConfig) ([]asset.GroupResult, error)) *AssetService_GroupAssets_Call {
_c.Call.Return(run)
return _c
}
// SearchAssets provides a mock function with given fields: ctx, cfg
func (_m *AssetService) SearchAssets(ctx context.Context, cfg asset.SearchConfig) ([]asset.SearchResult, error) {
ret := _m.Called(ctx, cfg)
var r0 []asset.SearchResult
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, asset.SearchConfig) ([]asset.SearchResult, error)); ok {
return rf(ctx, cfg)
}
if rf, ok := ret.Get(0).(func(context.Context, asset.SearchConfig) []asset.SearchResult); ok {
r0 = rf(ctx, cfg)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]asset.SearchResult)
}
}
if rf, ok := ret.Get(1).(func(context.Context, asset.SearchConfig) error); ok {
r1 = rf(ctx, cfg)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_SearchAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SearchAssets'
type AssetService_SearchAssets_Call struct {
*mock.Call
}
// SearchAssets is a helper method to define mock.On call
// - ctx context.Context
// - cfg asset.SearchConfig
func (_e *AssetService_Expecter) SearchAssets(ctx interface{}, cfg interface{}) *AssetService_SearchAssets_Call {
return &AssetService_SearchAssets_Call{Call: _e.mock.On("SearchAssets", ctx, cfg)}
}
func (_c *AssetService_SearchAssets_Call) Run(run func(ctx context.Context, cfg asset.SearchConfig)) *AssetService_SearchAssets_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(asset.SearchConfig))
})
return _c
}
func (_c *AssetService_SearchAssets_Call) Return(results []asset.SearchResult, err error) *AssetService_SearchAssets_Call {
_c.Call.Return(results, err)
return _c
}
func (_c *AssetService_SearchAssets_Call) RunAndReturn(run func(context.Context, asset.SearchConfig) ([]asset.SearchResult, error)) *AssetService_SearchAssets_Call {
_c.Call.Return(run)
return _c
}
// SuggestAssets provides a mock function with given fields: ctx, cfg
func (_m *AssetService) SuggestAssets(ctx context.Context, cfg asset.SearchConfig) ([]string, error) {
ret := _m.Called(ctx, cfg)
var r0 []string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, asset.SearchConfig) ([]string, error)); ok {
return rf(ctx, cfg)
}
if rf, ok := ret.Get(0).(func(context.Context, asset.SearchConfig) []string); ok {
r0 = rf(ctx, cfg)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]string)
}
}
if rf, ok := ret.Get(1).(func(context.Context, asset.SearchConfig) error); ok {
r1 = rf(ctx, cfg)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_SuggestAssets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SuggestAssets'
type AssetService_SuggestAssets_Call struct {
*mock.Call
}
// SuggestAssets is a helper method to define mock.On call
// - ctx context.Context
// - cfg asset.SearchConfig
func (_e *AssetService_Expecter) SuggestAssets(ctx interface{}, cfg interface{}) *AssetService_SuggestAssets_Call {
return &AssetService_SuggestAssets_Call{Call: _e.mock.On("SuggestAssets", ctx, cfg)}
}
func (_c *AssetService_SuggestAssets_Call) Run(run func(ctx context.Context, cfg asset.SearchConfig)) *AssetService_SuggestAssets_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(asset.SearchConfig))
})
return _c
}
func (_c *AssetService_SuggestAssets_Call) Return(suggestions []string, err error) *AssetService_SuggestAssets_Call {
_c.Call.Return(suggestions, err)
return _c
}
func (_c *AssetService_SuggestAssets_Call) RunAndReturn(run func(context.Context, asset.SearchConfig) ([]string, error)) *AssetService_SuggestAssets_Call {
_c.Call.Return(run)
return _c
}
// UpsertAsset provides a mock function with given fields: ctx, ast, upstreams, downstreams
func (_m *AssetService) UpsertAsset(ctx context.Context, ast *asset.Asset, upstreams []string, downstreams []string) (string, error) {
ret := _m.Called(ctx, ast, upstreams, downstreams)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *asset.Asset, []string, []string) (string, error)); ok {
return rf(ctx, ast, upstreams, downstreams)
}
if rf, ok := ret.Get(0).(func(context.Context, *asset.Asset, []string, []string) string); ok {
r0 = rf(ctx, ast, upstreams, downstreams)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *asset.Asset, []string, []string) error); ok {
r1 = rf(ctx, ast, upstreams, downstreams)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_UpsertAsset_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertAsset'
type AssetService_UpsertAsset_Call struct {
*mock.Call
}
// UpsertAsset is a helper method to define mock.On call
// - ctx context.Context
// - ast *asset.Asset
// - upstreams []string
// - downstreams []string
func (_e *AssetService_Expecter) UpsertAsset(ctx interface{}, ast interface{}, upstreams interface{}, downstreams interface{}) *AssetService_UpsertAsset_Call {
return &AssetService_UpsertAsset_Call{Call: _e.mock.On("UpsertAsset", ctx, ast, upstreams, downstreams)}
}
func (_c *AssetService_UpsertAsset_Call) Run(run func(ctx context.Context, ast *asset.Asset, upstreams []string, downstreams []string)) *AssetService_UpsertAsset_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*asset.Asset), args[2].([]string), args[3].([]string))
})
return _c
}
func (_c *AssetService_UpsertAsset_Call) Return(_a0 string, _a1 error) *AssetService_UpsertAsset_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AssetService_UpsertAsset_Call) RunAndReturn(run func(context.Context, *asset.Asset, []string, []string) (string, error)) *AssetService_UpsertAsset_Call {
_c.Call.Return(run)
return _c
}
// UpsertAssetWithoutLineage provides a mock function with given fields: ctx, ast
func (_m *AssetService) UpsertAssetWithoutLineage(ctx context.Context, ast *asset.Asset) (string, error) {
ret := _m.Called(ctx, ast)
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, *asset.Asset) (string, error)); ok {
return rf(ctx, ast)
}
if rf, ok := ret.Get(0).(func(context.Context, *asset.Asset) string); ok {
r0 = rf(ctx, ast)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, *asset.Asset) error); ok {
r1 = rf(ctx, ast)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// AssetService_UpsertAssetWithoutLineage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpsertAssetWithoutLineage'
type AssetService_UpsertAssetWithoutLineage_Call struct {
*mock.Call
}
// UpsertAssetWithoutLineage is a helper method to define mock.On call
// - ctx context.Context
// - ast *asset.Asset
func (_e *AssetService_Expecter) UpsertAssetWithoutLineage(ctx interface{}, ast interface{}) *AssetService_UpsertAssetWithoutLineage_Call {
return &AssetService_UpsertAssetWithoutLineage_Call{Call: _e.mock.On("UpsertAssetWithoutLineage", ctx, ast)}
}
func (_c *AssetService_UpsertAssetWithoutLineage_Call) Run(run func(ctx context.Context, ast *asset.Asset)) *AssetService_UpsertAssetWithoutLineage_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context), args[1].(*asset.Asset))
})
return _c
}
func (_c *AssetService_UpsertAssetWithoutLineage_Call) Return(_a0 string, _a1 error) *AssetService_UpsertAssetWithoutLineage_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *AssetService_UpsertAssetWithoutLineage_Call) RunAndReturn(run func(context.Context, *asset.Asset) (string, error)) *AssetService_UpsertAssetWithoutLineage_Call {
_c.Call.Return(run)
return _c
}
type mockConstructorTestingTNewAssetService interface {
mock.TestingT
Cleanup(func())
}
// NewAssetService creates a new instance of AssetService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewAssetService(t mockConstructorTestingTNewAssetService) *AssetService {
mock := &AssetService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}