-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathsnapshots_mock.go
452 lines (366 loc) · 13.8 KB
/
snapshots_mock.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
// Code generated by mockery. DO NOT EDIT.
package dao
import (
context "context"
api "github.com/content-services/content-sources-backend/pkg/api"
mock "github.com/stretchr/testify/mock"
models "github.com/content-services/content-sources-backend/pkg/models"
)
// MockSnapshotDao is an autogenerated mock type for the SnapshotDao type
type MockSnapshotDao struct {
mock.Mock
}
// BulkDelete provides a mock function with given fields: ctx, uuids
func (_m *MockSnapshotDao) BulkDelete(ctx context.Context, uuids []string) []error {
ret := _m.Called(ctx, uuids)
if len(ret) == 0 {
panic("no return value specified for BulkDelete")
}
var r0 []error
if rf, ok := ret.Get(0).(func(context.Context, []string) []error); ok {
r0 = rf(ctx, uuids)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]error)
}
}
return r0
}
// ClearDeletedAt provides a mock function with given fields: ctx, snapUUID
func (_m *MockSnapshotDao) ClearDeletedAt(ctx context.Context, snapUUID string) error {
ret := _m.Called(ctx, snapUUID)
if len(ret) == 0 {
panic("no return value specified for ClearDeletedAt")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, snapUUID)
} else {
r0 = ret.Error(0)
}
return r0
}
// Create provides a mock function with given fields: ctx, snap
func (_m *MockSnapshotDao) Create(ctx context.Context, snap *models.Snapshot) error {
ret := _m.Called(ctx, snap)
if len(ret) == 0 {
panic("no return value specified for Create")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *models.Snapshot) error); ok {
r0 = rf(ctx, snap)
} else {
r0 = ret.Error(0)
}
return r0
}
// Delete provides a mock function with given fields: ctx, snapUUID
func (_m *MockSnapshotDao) Delete(ctx context.Context, snapUUID string) error {
ret := _m.Called(ctx, snapUUID)
if len(ret) == 0 {
panic("no return value specified for Delete")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, snapUUID)
} else {
r0 = ret.Error(0)
}
return r0
}
// Fetch provides a mock function with given fields: ctx, uuid
func (_m *MockSnapshotDao) Fetch(ctx context.Context, uuid string) (api.SnapshotResponse, error) {
ret := _m.Called(ctx, uuid)
if len(ret) == 0 {
panic("no return value specified for Fetch")
}
var r0 api.SnapshotResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (api.SnapshotResponse, error)); ok {
return rf(ctx, uuid)
}
if rf, ok := ret.Get(0).(func(context.Context, string) api.SnapshotResponse); ok {
r0 = rf(ctx, uuid)
} else {
r0 = ret.Get(0).(api.SnapshotResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, uuid)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchForRepoConfigUUID provides a mock function with given fields: ctx, repoConfigUUID, inclSoftDel
func (_m *MockSnapshotDao) FetchForRepoConfigUUID(ctx context.Context, repoConfigUUID string, inclSoftDel bool) ([]models.Snapshot, error) {
ret := _m.Called(ctx, repoConfigUUID, inclSoftDel)
if len(ret) == 0 {
panic("no return value specified for FetchForRepoConfigUUID")
}
var r0 []models.Snapshot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, bool) ([]models.Snapshot, error)); ok {
return rf(ctx, repoConfigUUID, inclSoftDel)
}
if rf, ok := ret.Get(0).(func(context.Context, string, bool) []models.Snapshot); ok {
r0 = rf(ctx, repoConfigUUID, inclSoftDel)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]models.Snapshot)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok {
r1 = rf(ctx, repoConfigUUID, inclSoftDel)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchLatestSnapshot provides a mock function with given fields: ctx, repoConfigUUID
func (_m *MockSnapshotDao) FetchLatestSnapshot(ctx context.Context, repoConfigUUID string) (api.SnapshotResponse, error) {
ret := _m.Called(ctx, repoConfigUUID)
if len(ret) == 0 {
panic("no return value specified for FetchLatestSnapshot")
}
var r0 api.SnapshotResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (api.SnapshotResponse, error)); ok {
return rf(ctx, repoConfigUUID)
}
if rf, ok := ret.Get(0).(func(context.Context, string) api.SnapshotResponse); ok {
r0 = rf(ctx, repoConfigUUID)
} else {
r0 = ret.Get(0).(api.SnapshotResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, repoConfigUUID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchLatestSnapshotModel provides a mock function with given fields: ctx, repoConfigUUID
func (_m *MockSnapshotDao) FetchLatestSnapshotModel(ctx context.Context, repoConfigUUID string) (models.Snapshot, error) {
ret := _m.Called(ctx, repoConfigUUID)
if len(ret) == 0 {
panic("no return value specified for FetchLatestSnapshotModel")
}
var r0 models.Snapshot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string) (models.Snapshot, error)); ok {
return rf(ctx, repoConfigUUID)
}
if rf, ok := ret.Get(0).(func(context.Context, string) models.Snapshot); ok {
r0 = rf(ctx, repoConfigUUID)
} else {
r0 = ret.Get(0).(models.Snapshot)
}
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, repoConfigUUID)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchModel provides a mock function with given fields: ctx, uuid, includeSoftDel
func (_m *MockSnapshotDao) FetchModel(ctx context.Context, uuid string, includeSoftDel bool) (models.Snapshot, error) {
ret := _m.Called(ctx, uuid, includeSoftDel)
if len(ret) == 0 {
panic("no return value specified for FetchModel")
}
var r0 models.Snapshot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, bool) (models.Snapshot, error)); ok {
return rf(ctx, uuid, includeSoftDel)
}
if rf, ok := ret.Get(0).(func(context.Context, string, bool) models.Snapshot); ok {
r0 = rf(ctx, uuid, includeSoftDel)
} else {
r0 = ret.Get(0).(models.Snapshot)
}
if rf, ok := ret.Get(1).(func(context.Context, string, bool) error); ok {
r1 = rf(ctx, uuid, includeSoftDel)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchSnapshotByVersionHref provides a mock function with given fields: ctx, repoConfigUUID, versionHref
func (_m *MockSnapshotDao) FetchSnapshotByVersionHref(ctx context.Context, repoConfigUUID string, versionHref string) (*api.SnapshotResponse, error) {
ret := _m.Called(ctx, repoConfigUUID, versionHref)
if len(ret) == 0 {
panic("no return value specified for FetchSnapshotByVersionHref")
}
var r0 *api.SnapshotResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string) (*api.SnapshotResponse, error)); ok {
return rf(ctx, repoConfigUUID, versionHref)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string) *api.SnapshotResponse); ok {
r0 = rf(ctx, repoConfigUUID, versionHref)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.SnapshotResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = rf(ctx, repoConfigUUID, versionHref)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchSnapshotsByDateAndRepository provides a mock function with given fields: ctx, orgID, request
func (_m *MockSnapshotDao) FetchSnapshotsByDateAndRepository(ctx context.Context, orgID string, request api.ListSnapshotByDateRequest) (api.ListSnapshotByDateResponse, error) {
ret := _m.Called(ctx, orgID, request)
if len(ret) == 0 {
panic("no return value specified for FetchSnapshotsByDateAndRepository")
}
var r0 api.ListSnapshotByDateResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, api.ListSnapshotByDateRequest) (api.ListSnapshotByDateResponse, error)); ok {
return rf(ctx, orgID, request)
}
if rf, ok := ret.Get(0).(func(context.Context, string, api.ListSnapshotByDateRequest) api.ListSnapshotByDateResponse); ok {
r0 = rf(ctx, orgID, request)
} else {
r0 = ret.Get(0).(api.ListSnapshotByDateResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string, api.ListSnapshotByDateRequest) error); ok {
r1 = rf(ctx, orgID, request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchSnapshotsModelByDateAndRepository provides a mock function with given fields: ctx, orgID, request
func (_m *MockSnapshotDao) FetchSnapshotsModelByDateAndRepository(ctx context.Context, orgID string, request api.ListSnapshotByDateRequest) ([]models.Snapshot, error) {
ret := _m.Called(ctx, orgID, request)
if len(ret) == 0 {
panic("no return value specified for FetchSnapshotsModelByDateAndRepository")
}
var r0 []models.Snapshot
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, api.ListSnapshotByDateRequest) ([]models.Snapshot, error)); ok {
return rf(ctx, orgID, request)
}
if rf, ok := ret.Get(0).(func(context.Context, string, api.ListSnapshotByDateRequest) []models.Snapshot); ok {
r0 = rf(ctx, orgID, request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]models.Snapshot)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, api.ListSnapshotByDateRequest) error); ok {
r1 = rf(ctx, orgID, request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetRepositoryConfigurationFile provides a mock function with given fields: ctx, orgID, snapshotUUID, isLatest
func (_m *MockSnapshotDao) GetRepositoryConfigurationFile(ctx context.Context, orgID string, snapshotUUID string, isLatest bool) (string, error) {
ret := _m.Called(ctx, orgID, snapshotUUID, isLatest)
if len(ret) == 0 {
panic("no return value specified for GetRepositoryConfigurationFile")
}
var r0 string
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) (string, error)); ok {
return rf(ctx, orgID, snapshotUUID, isLatest)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, bool) string); ok {
r0 = rf(ctx, orgID, snapshotUUID, isLatest)
} else {
r0 = ret.Get(0).(string)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, bool) error); ok {
r1 = rf(ctx, orgID, snapshotUUID, isLatest)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, orgID, repoConfigUuid, paginationData, filterData
func (_m *MockSnapshotDao) List(ctx context.Context, orgID string, repoConfigUuid string, paginationData api.PaginationData, filterData api.FilterData) (api.SnapshotCollectionResponse, int64, error) {
ret := _m.Called(ctx, orgID, repoConfigUuid, paginationData, filterData)
if len(ret) == 0 {
panic("no return value specified for List")
}
var r0 api.SnapshotCollectionResponse
var r1 int64
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, api.PaginationData, api.FilterData) (api.SnapshotCollectionResponse, int64, error)); ok {
return rf(ctx, orgID, repoConfigUuid, paginationData, filterData)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, api.PaginationData, api.FilterData) api.SnapshotCollectionResponse); ok {
r0 = rf(ctx, orgID, repoConfigUuid, paginationData, filterData)
} else {
r0 = ret.Get(0).(api.SnapshotCollectionResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, api.PaginationData, api.FilterData) int64); ok {
r1 = rf(ctx, orgID, repoConfigUuid, paginationData, filterData)
} else {
r1 = ret.Get(1).(int64)
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, api.PaginationData, api.FilterData) error); ok {
r2 = rf(ctx, orgID, repoConfigUuid, paginationData, filterData)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// ListByTemplate provides a mock function with given fields: ctx, orgID, template, repositorySearch, paginationData
func (_m *MockSnapshotDao) ListByTemplate(ctx context.Context, orgID string, template api.TemplateResponse, repositorySearch string, paginationData api.PaginationData) (api.SnapshotCollectionResponse, int64, error) {
ret := _m.Called(ctx, orgID, template, repositorySearch, paginationData)
if len(ret) == 0 {
panic("no return value specified for ListByTemplate")
}
var r0 api.SnapshotCollectionResponse
var r1 int64
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, api.TemplateResponse, string, api.PaginationData) (api.SnapshotCollectionResponse, int64, error)); ok {
return rf(ctx, orgID, template, repositorySearch, paginationData)
}
if rf, ok := ret.Get(0).(func(context.Context, string, api.TemplateResponse, string, api.PaginationData) api.SnapshotCollectionResponse); ok {
r0 = rf(ctx, orgID, template, repositorySearch, paginationData)
} else {
r0 = ret.Get(0).(api.SnapshotCollectionResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string, api.TemplateResponse, string, api.PaginationData) int64); ok {
r1 = rf(ctx, orgID, template, repositorySearch, paginationData)
} else {
r1 = ret.Get(1).(int64)
}
if rf, ok := ret.Get(2).(func(context.Context, string, api.TemplateResponse, string, api.PaginationData) error); ok {
r2 = rf(ctx, orgID, template, repositorySearch, paginationData)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// SoftDelete provides a mock function with given fields: ctx, snapUUID
func (_m *MockSnapshotDao) SoftDelete(ctx context.Context, snapUUID string) error {
ret := _m.Called(ctx, snapUUID)
if len(ret) == 0 {
panic("no return value specified for SoftDelete")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, snapUUID)
} else {
r0 = ret.Error(0)
}
return r0
}
// NewMockSnapshotDao creates a new instance of MockSnapshotDao. 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 NewMockSnapshotDao(t interface {
mock.TestingT
Cleanup(func())
}) *MockSnapshotDao {
mock := &MockSnapshotDao{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}