-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathrpms_mock.go
353 lines (289 loc) · 11.6 KB
/
rpms_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
// 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"
tangy "github.com/content-services/tang/pkg/tangy"
yum "github.com/content-services/yummy/pkg/yum"
)
// MockRpmDao is an autogenerated mock type for the RpmDao type
type MockRpmDao struct {
mock.Mock
}
// DetectRpms provides a mock function with given fields: ctx, orgID, request
func (_m *MockRpmDao) DetectRpms(ctx context.Context, orgID string, request api.DetectRpmsRequest) (*api.DetectRpmsResponse, error) {
ret := _m.Called(ctx, orgID, request)
if len(ret) == 0 {
panic("no return value specified for DetectRpms")
}
var r0 *api.DetectRpmsResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, api.DetectRpmsRequest) (*api.DetectRpmsResponse, error)); ok {
return rf(ctx, orgID, request)
}
if rf, ok := ret.Get(0).(func(context.Context, string, api.DetectRpmsRequest) *api.DetectRpmsResponse); ok {
r0 = rf(ctx, orgID, request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.DetectRpmsResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, api.DetectRpmsRequest) error); ok {
r1 = rf(ctx, orgID, request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// InsertForRepository provides a mock function with given fields: ctx, repoUuid, pkgs
func (_m *MockRpmDao) InsertForRepository(ctx context.Context, repoUuid string, pkgs []yum.Package) (int64, error) {
ret := _m.Called(ctx, repoUuid, pkgs)
if len(ret) == 0 {
panic("no return value specified for InsertForRepository")
}
var r0 int64
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, []yum.Package) (int64, error)); ok {
return rf(ctx, repoUuid, pkgs)
}
if rf, ok := ret.Get(0).(func(context.Context, string, []yum.Package) int64); ok {
r0 = rf(ctx, repoUuid, pkgs)
} else {
r0 = ret.Get(0).(int64)
}
if rf, ok := ret.Get(1).(func(context.Context, string, []yum.Package) error); ok {
r1 = rf(ctx, repoUuid, pkgs)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: ctx, orgID, uuidRepo, limit, offset, search, sortBy
func (_m *MockRpmDao) List(ctx context.Context, orgID string, uuidRepo string, limit int, offset int, search string, sortBy string) (api.RepositoryRpmCollectionResponse, int64, error) {
ret := _m.Called(ctx, orgID, uuidRepo, limit, offset, search, sortBy)
if len(ret) == 0 {
panic("no return value specified for List")
}
var r0 api.RepositoryRpmCollectionResponse
var r1 int64
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, int, int, string, string) (api.RepositoryRpmCollectionResponse, int64, error)); ok {
return rf(ctx, orgID, uuidRepo, limit, offset, search, sortBy)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, int, int, string, string) api.RepositoryRpmCollectionResponse); ok {
r0 = rf(ctx, orgID, uuidRepo, limit, offset, search, sortBy)
} else {
r0 = ret.Get(0).(api.RepositoryRpmCollectionResponse)
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, int, int, string, string) int64); ok {
r1 = rf(ctx, orgID, uuidRepo, limit, offset, search, sortBy)
} else {
r1 = ret.Get(1).(int64)
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, int, int, string, string) error); ok {
r2 = rf(ctx, orgID, uuidRepo, limit, offset, search, sortBy)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// ListSnapshotErrata provides a mock function with given fields: ctx, orgId, snapshotUUIDs, filters, pageOpts
func (_m *MockRpmDao) ListSnapshotErrata(ctx context.Context, orgId string, snapshotUUIDs []string, filters tangy.ErrataListFilters, pageOpts api.PaginationData) ([]api.SnapshotErrata, int, error) {
ret := _m.Called(ctx, orgId, snapshotUUIDs, filters, pageOpts)
if len(ret) == 0 {
panic("no return value specified for ListSnapshotErrata")
}
var r0 []api.SnapshotErrata
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, []string, tangy.ErrataListFilters, api.PaginationData) ([]api.SnapshotErrata, int, error)); ok {
return rf(ctx, orgId, snapshotUUIDs, filters, pageOpts)
}
if rf, ok := ret.Get(0).(func(context.Context, string, []string, tangy.ErrataListFilters, api.PaginationData) []api.SnapshotErrata); ok {
r0 = rf(ctx, orgId, snapshotUUIDs, filters, pageOpts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.SnapshotErrata)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, []string, tangy.ErrataListFilters, api.PaginationData) int); ok {
r1 = rf(ctx, orgId, snapshotUUIDs, filters, pageOpts)
} else {
r1 = ret.Get(1).(int)
}
if rf, ok := ret.Get(2).(func(context.Context, string, []string, tangy.ErrataListFilters, api.PaginationData) error); ok {
r2 = rf(ctx, orgId, snapshotUUIDs, filters, pageOpts)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// ListSnapshotRpms provides a mock function with given fields: ctx, orgId, snapshotUUIDs, search, pageOpts
func (_m *MockRpmDao) ListSnapshotRpms(ctx context.Context, orgId string, snapshotUUIDs []string, search string, pageOpts api.PaginationData) ([]api.SnapshotRpm, int, error) {
ret := _m.Called(ctx, orgId, snapshotUUIDs, search, pageOpts)
if len(ret) == 0 {
panic("no return value specified for ListSnapshotRpms")
}
var r0 []api.SnapshotRpm
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, []string, string, api.PaginationData) ([]api.SnapshotRpm, int, error)); ok {
return rf(ctx, orgId, snapshotUUIDs, search, pageOpts)
}
if rf, ok := ret.Get(0).(func(context.Context, string, []string, string, api.PaginationData) []api.SnapshotRpm); ok {
r0 = rf(ctx, orgId, snapshotUUIDs, search, pageOpts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.SnapshotRpm)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, []string, string, api.PaginationData) int); ok {
r1 = rf(ctx, orgId, snapshotUUIDs, search, pageOpts)
} else {
r1 = ret.Get(1).(int)
}
if rf, ok := ret.Get(2).(func(context.Context, string, []string, string, api.PaginationData) error); ok {
r2 = rf(ctx, orgId, snapshotUUIDs, search, pageOpts)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// ListTemplateErrata provides a mock function with given fields: ctx, orgId, templateUUID, filters, pageOpts
func (_m *MockRpmDao) ListTemplateErrata(ctx context.Context, orgId string, templateUUID string, filters tangy.ErrataListFilters, pageOpts api.PaginationData) ([]api.SnapshotErrata, int, error) {
ret := _m.Called(ctx, orgId, templateUUID, filters, pageOpts)
if len(ret) == 0 {
panic("no return value specified for ListTemplateErrata")
}
var r0 []api.SnapshotErrata
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, tangy.ErrataListFilters, api.PaginationData) ([]api.SnapshotErrata, int, error)); ok {
return rf(ctx, orgId, templateUUID, filters, pageOpts)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, tangy.ErrataListFilters, api.PaginationData) []api.SnapshotErrata); ok {
r0 = rf(ctx, orgId, templateUUID, filters, pageOpts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.SnapshotErrata)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, tangy.ErrataListFilters, api.PaginationData) int); ok {
r1 = rf(ctx, orgId, templateUUID, filters, pageOpts)
} else {
r1 = ret.Get(1).(int)
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, tangy.ErrataListFilters, api.PaginationData) error); ok {
r2 = rf(ctx, orgId, templateUUID, filters, pageOpts)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// ListTemplateRpms provides a mock function with given fields: ctx, orgId, templateUUID, search, pageOpts
func (_m *MockRpmDao) ListTemplateRpms(ctx context.Context, orgId string, templateUUID string, search string, pageOpts api.PaginationData) ([]api.SnapshotRpm, int, error) {
ret := _m.Called(ctx, orgId, templateUUID, search, pageOpts)
if len(ret) == 0 {
panic("no return value specified for ListTemplateRpms")
}
var r0 []api.SnapshotRpm
var r1 int
var r2 error
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, api.PaginationData) ([]api.SnapshotRpm, int, error)); ok {
return rf(ctx, orgId, templateUUID, search, pageOpts)
}
if rf, ok := ret.Get(0).(func(context.Context, string, string, string, api.PaginationData) []api.SnapshotRpm); ok {
r0 = rf(ctx, orgId, templateUUID, search, pageOpts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.SnapshotRpm)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, string, string, api.PaginationData) int); ok {
r1 = rf(ctx, orgId, templateUUID, search, pageOpts)
} else {
r1 = ret.Get(1).(int)
}
if rf, ok := ret.Get(2).(func(context.Context, string, string, string, api.PaginationData) error); ok {
r2 = rf(ctx, orgId, templateUUID, search, pageOpts)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// OrphanCleanup provides a mock function with given fields: ctx
func (_m *MockRpmDao) OrphanCleanup(ctx context.Context) error {
ret := _m.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for OrphanCleanup")
}
var r0 error
if rf, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = rf(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// Search provides a mock function with given fields: ctx, orgID, request
func (_m *MockRpmDao) Search(ctx context.Context, orgID string, request api.ContentUnitSearchRequest) ([]api.SearchRpmResponse, error) {
ret := _m.Called(ctx, orgID, request)
if len(ret) == 0 {
panic("no return value specified for Search")
}
var r0 []api.SearchRpmResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, api.ContentUnitSearchRequest) ([]api.SearchRpmResponse, error)); ok {
return rf(ctx, orgID, request)
}
if rf, ok := ret.Get(0).(func(context.Context, string, api.ContentUnitSearchRequest) []api.SearchRpmResponse); ok {
r0 = rf(ctx, orgID, request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.SearchRpmResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, api.ContentUnitSearchRequest) error); ok {
r1 = rf(ctx, orgID, request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// SearchSnapshotRpms provides a mock function with given fields: ctx, orgId, request
func (_m *MockRpmDao) SearchSnapshotRpms(ctx context.Context, orgId string, request api.SnapshotSearchRpmRequest) ([]api.SearchRpmResponse, error) {
ret := _m.Called(ctx, orgId, request)
if len(ret) == 0 {
panic("no return value specified for SearchSnapshotRpms")
}
var r0 []api.SearchRpmResponse
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, api.SnapshotSearchRpmRequest) ([]api.SearchRpmResponse, error)); ok {
return rf(ctx, orgId, request)
}
if rf, ok := ret.Get(0).(func(context.Context, string, api.SnapshotSearchRpmRequest) []api.SearchRpmResponse); ok {
r0 = rf(ctx, orgId, request)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.SearchRpmResponse)
}
}
if rf, ok := ret.Get(1).(func(context.Context, string, api.SnapshotSearchRpmRequest) error); ok {
r1 = rf(ctx, orgId, request)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// NewMockRpmDao creates a new instance of MockRpmDao. 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 NewMockRpmDao(t interface {
mock.TestingT
Cleanup(func())
}) *MockRpmDao {
mock := &MockRpmDao{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}