/
repository_configs_mock.go
391 lines (320 loc) · 11 KB
/
repository_configs_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
// Code generated by mockery v2.36.1. 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"
)
// MockRepositoryConfigDao is an autogenerated mock type for the RepositoryConfigDao type
type MockRepositoryConfigDao struct {
mock.Mock
}
// BulkCreate provides a mock function with given fields: newRepositories
func (_m *MockRepositoryConfigDao) BulkCreate(newRepositories []api.RepositoryRequest) ([]api.RepositoryResponse, []error) {
ret := _m.Called(newRepositories)
var r0 []api.RepositoryResponse
var r1 []error
if rf, ok := ret.Get(0).(func([]api.RepositoryRequest) ([]api.RepositoryResponse, []error)); ok {
return rf(newRepositories)
}
if rf, ok := ret.Get(0).(func([]api.RepositoryRequest) []api.RepositoryResponse); ok {
r0 = rf(newRepositories)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.RepositoryResponse)
}
}
if rf, ok := ret.Get(1).(func([]api.RepositoryRequest) []error); ok {
r1 = rf(newRepositories)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).([]error)
}
}
return r0, r1
}
// BulkDelete provides a mock function with given fields: orgID, uuids
func (_m *MockRepositoryConfigDao) BulkDelete(orgID string, uuids []string) []error {
ret := _m.Called(orgID, uuids)
var r0 []error
if rf, ok := ret.Get(0).(func(string, []string) []error); ok {
r0 = rf(orgID, uuids)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]error)
}
}
return r0
}
// Create provides a mock function with given fields: newRepo
func (_m *MockRepositoryConfigDao) Create(newRepo api.RepositoryRequest) (api.RepositoryResponse, error) {
ret := _m.Called(newRepo)
var r0 api.RepositoryResponse
var r1 error
if rf, ok := ret.Get(0).(func(api.RepositoryRequest) (api.RepositoryResponse, error)); ok {
return rf(newRepo)
}
if rf, ok := ret.Get(0).(func(api.RepositoryRequest) api.RepositoryResponse); ok {
r0 = rf(newRepo)
} else {
r0 = ret.Get(0).(api.RepositoryResponse)
}
if rf, ok := ret.Get(1).(func(api.RepositoryRequest) error); ok {
r1 = rf(newRepo)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Delete provides a mock function with given fields: orgID, uuid
func (_m *MockRepositoryConfigDao) Delete(orgID string, uuid string) error {
ret := _m.Called(orgID, uuid)
var r0 error
if rf, ok := ret.Get(0).(func(string, string) error); ok {
r0 = rf(orgID, uuid)
} else {
r0 = ret.Error(0)
}
return r0
}
// Fetch provides a mock function with given fields: orgID, uuid
func (_m *MockRepositoryConfigDao) Fetch(orgID string, uuid string) (api.RepositoryResponse, error) {
ret := _m.Called(orgID, uuid)
var r0 api.RepositoryResponse
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (api.RepositoryResponse, error)); ok {
return rf(orgID, uuid)
}
if rf, ok := ret.Get(0).(func(string, string) api.RepositoryResponse); ok {
r0 = rf(orgID, uuid)
} else {
r0 = ret.Get(0).(api.RepositoryResponse)
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(orgID, uuid)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchByRepoUuid provides a mock function with given fields: orgID, repoUuid
func (_m *MockRepositoryConfigDao) FetchByRepoUuid(orgID string, repoUuid string) (api.RepositoryResponse, error) {
ret := _m.Called(orgID, repoUuid)
var r0 api.RepositoryResponse
var r1 error
if rf, ok := ret.Get(0).(func(string, string) (api.RepositoryResponse, error)); ok {
return rf(orgID, repoUuid)
}
if rf, ok := ret.Get(0).(func(string, string) api.RepositoryResponse); ok {
r0 = rf(orgID, repoUuid)
} else {
r0 = ret.Get(0).(api.RepositoryResponse)
}
if rf, ok := ret.Get(1).(func(string, string) error); ok {
r1 = rf(orgID, repoUuid)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// FetchWithoutOrgID provides a mock function with given fields: uuid
func (_m *MockRepositoryConfigDao) FetchWithoutOrgID(uuid string) (api.RepositoryResponse, error) {
ret := _m.Called(uuid)
var r0 api.RepositoryResponse
var r1 error
if rf, ok := ret.Get(0).(func(string) (api.RepositoryResponse, error)); ok {
return rf(uuid)
}
if rf, ok := ret.Get(0).(func(string) api.RepositoryResponse); ok {
r0 = rf(uuid)
} else {
r0 = ret.Get(0).(api.RepositoryResponse)
}
if rf, ok := ret.Get(1).(func(string) error); ok {
r1 = rf(uuid)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// InternalOnly_FetchRepoConfigsForRepoUUID provides a mock function with given fields: uuid
func (_m *MockRepositoryConfigDao) InternalOnly_FetchRepoConfigsForRepoUUID(uuid string) []api.RepositoryResponse {
ret := _m.Called(uuid)
var r0 []api.RepositoryResponse
if rf, ok := ret.Get(0).(func(string) []api.RepositoryResponse); ok {
r0 = rf(uuid)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]api.RepositoryResponse)
}
}
return r0
}
// InternalOnly_ListReposToSnapshot provides a mock function with given fields: filter
func (_m *MockRepositoryConfigDao) InternalOnly_ListReposToSnapshot(filter *ListRepoFilter) ([]models.RepositoryConfiguration, error) {
ret := _m.Called(filter)
var r0 []models.RepositoryConfiguration
var r1 error
if rf, ok := ret.Get(0).(func(*ListRepoFilter) ([]models.RepositoryConfiguration, error)); ok {
return rf(filter)
}
if rf, ok := ret.Get(0).(func(*ListRepoFilter) []models.RepositoryConfiguration); ok {
r0 = rf(filter)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]models.RepositoryConfiguration)
}
}
if rf, ok := ret.Get(1).(func(*ListRepoFilter) error); ok {
r1 = rf(filter)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// InternalOnly_RefreshRedHatRepo provides a mock function with given fields: request, label
func (_m *MockRepositoryConfigDao) InternalOnly_RefreshRedHatRepo(request api.RepositoryRequest, label string) (*api.RepositoryResponse, error) {
ret := _m.Called(request, label)
var r0 *api.RepositoryResponse
var r1 error
if rf, ok := ret.Get(0).(func(api.RepositoryRequest, string) (*api.RepositoryResponse, error)); ok {
return rf(request, label)
}
if rf, ok := ret.Get(0).(func(api.RepositoryRequest, string) *api.RepositoryResponse); ok {
r0 = rf(request, label)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*api.RepositoryResponse)
}
}
if rf, ok := ret.Get(1).(func(api.RepositoryRequest, string) error); ok {
r1 = rf(request, label)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// List provides a mock function with given fields: orgID, paginationData, filterData
func (_m *MockRepositoryConfigDao) List(orgID string, paginationData api.PaginationData, filterData api.FilterData) (api.RepositoryCollectionResponse, int64, error) {
ret := _m.Called(orgID, paginationData, filterData)
var r0 api.RepositoryCollectionResponse
var r1 int64
var r2 error
if rf, ok := ret.Get(0).(func(string, api.PaginationData, api.FilterData) (api.RepositoryCollectionResponse, int64, error)); ok {
return rf(orgID, paginationData, filterData)
}
if rf, ok := ret.Get(0).(func(string, api.PaginationData, api.FilterData) api.RepositoryCollectionResponse); ok {
r0 = rf(orgID, paginationData, filterData)
} else {
r0 = ret.Get(0).(api.RepositoryCollectionResponse)
}
if rf, ok := ret.Get(1).(func(string, api.PaginationData, api.FilterData) int64); ok {
r1 = rf(orgID, paginationData, filterData)
} else {
r1 = ret.Get(1).(int64)
}
if rf, ok := ret.Get(2).(func(string, api.PaginationData, api.FilterData) error); ok {
r2 = rf(orgID, paginationData, filterData)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// SavePublicRepos provides a mock function with given fields: urls
func (_m *MockRepositoryConfigDao) SavePublicRepos(urls []string) error {
ret := _m.Called(urls)
var r0 error
if rf, ok := ret.Get(0).(func([]string) error); ok {
r0 = rf(urls)
} else {
r0 = ret.Error(0)
}
return r0
}
// SoftDelete provides a mock function with given fields: orgID, uuid
func (_m *MockRepositoryConfigDao) SoftDelete(orgID string, uuid string) error {
ret := _m.Called(orgID, uuid)
var r0 error
if rf, ok := ret.Get(0).(func(string, string) error); ok {
r0 = rf(orgID, uuid)
} else {
r0 = ret.Error(0)
}
return r0
}
// Update provides a mock function with given fields: orgID, uuid, repoParams
func (_m *MockRepositoryConfigDao) Update(orgID string, uuid string, repoParams api.RepositoryRequest) (bool, error) {
ret := _m.Called(orgID, uuid, repoParams)
var r0 bool
var r1 error
if rf, ok := ret.Get(0).(func(string, string, api.RepositoryRequest) (bool, error)); ok {
return rf(orgID, uuid, repoParams)
}
if rf, ok := ret.Get(0).(func(string, string, api.RepositoryRequest) bool); ok {
r0 = rf(orgID, uuid, repoParams)
} else {
r0 = ret.Get(0).(bool)
}
if rf, ok := ret.Get(1).(func(string, string, api.RepositoryRequest) error); ok {
r1 = rf(orgID, uuid, repoParams)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// UpdateLastSnapshotTask provides a mock function with given fields: taskUUID, orgID, repoUUID
func (_m *MockRepositoryConfigDao) UpdateLastSnapshotTask(taskUUID string, orgID string, repoUUID string) error {
ret := _m.Called(taskUUID, orgID, repoUUID)
var r0 error
if rf, ok := ret.Get(0).(func(string, string, string) error); ok {
r0 = rf(taskUUID, orgID, repoUUID)
} else {
r0 = ret.Error(0)
}
return r0
}
// ValidateParameters provides a mock function with given fields: orgId, params, excludedUUIDS
func (_m *MockRepositoryConfigDao) ValidateParameters(orgId string, params api.RepositoryValidationRequest, excludedUUIDS []string) (api.RepositoryValidationResponse, error) {
ret := _m.Called(orgId, params, excludedUUIDS)
var r0 api.RepositoryValidationResponse
var r1 error
if rf, ok := ret.Get(0).(func(string, api.RepositoryValidationRequest, []string) (api.RepositoryValidationResponse, error)); ok {
return rf(orgId, params, excludedUUIDS)
}
if rf, ok := ret.Get(0).(func(string, api.RepositoryValidationRequest, []string) api.RepositoryValidationResponse); ok {
r0 = rf(orgId, params, excludedUUIDS)
} else {
r0 = ret.Get(0).(api.RepositoryValidationResponse)
}
if rf, ok := ret.Get(1).(func(string, api.RepositoryValidationRequest, []string) error); ok {
r1 = rf(orgId, params, excludedUUIDS)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// WithContext provides a mock function with given fields: ctx
func (_m *MockRepositoryConfigDao) WithContext(ctx context.Context) RepositoryConfigDao {
ret := _m.Called(ctx)
var r0 RepositoryConfigDao
if rf, ok := ret.Get(0).(func(context.Context) RepositoryConfigDao); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(RepositoryConfigDao)
}
}
return r0
}
// NewMockRepositoryConfigDao creates a new instance of MockRepositoryConfigDao. 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 NewMockRepositoryConfigDao(t interface {
mock.TestingT
Cleanup(func())
}) *MockRepositoryConfigDao {
mock := &MockRepositoryConfigDao{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}