1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "io"
10 "time"
11
12 "github.com/bnema/gordon/internal/domain"
13 mock "github.com/stretchr/testify/mock"
14)
15
16// NewMockBackupStorage creates a new instance of MockBackupStorage. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
17// The first argument is typically a *testing.T value.
18func NewMockBackupStorage(t interface {
19 mock.TestingT
20 Cleanup(func())
21}) *MockBackupStorage {
22 if helper, ok := t.(interface{ Helper() }); ok {
23 helper.Helper()
24 }
25
26 mock := &MockBackupStorage{}
27 mock.Mock.Test(t)
28
29 t.Cleanup(func() {
30 if helper, ok := t.(interface{ Helper() }); ok {
31 helper.Helper()
32 }
33 mock.AssertExpectations(t)
34 })
35
36 return mock
37}
38
39// MockBackupStorage is an autogenerated mock type for the BackupStorage type
40type MockBackupStorage struct {
41 mock.Mock
42}
43
44type MockBackupStorage_Expecter struct {
45 mock *mock.Mock
46}
47
48func (_m *MockBackupStorage) EXPECT() *MockBackupStorage_Expecter {
49 return &MockBackupStorage_Expecter{mock: &_m.Mock}
50}
51
52// ApplyRetention provides a mock function for the type MockBackupStorage
53func (_mock *MockBackupStorage) ApplyRetention(ctx context.Context, app string, policy domain.DatabaseBackupRetentionPolicy) (int, error) {
54 ret := _mock.Called(ctx, app, policy)
55
56 if len(ret) == 0 {
57 panic("no return value specified for ApplyRetention")
58 }
59
60 var r0 int
61 var r1 error
62 if returnFunc, ok := ret.Get(0).(func(context.Context, string, domain.DatabaseBackupRetentionPolicy) (int, error)); ok {
63 return returnFunc(ctx, app, policy)
64 }
65 if returnFunc, ok := ret.Get(0).(func(context.Context, string, domain.DatabaseBackupRetentionPolicy) int); ok {
66 r0 = returnFunc(ctx, app, policy)
67 } else {
68 r0 = ret.Get(0).(int)
69 }
70 if returnFunc, ok := ret.Get(1).(func(context.Context, string, domain.DatabaseBackupRetentionPolicy) error); ok {
71 r1 = returnFunc(ctx, app, policy)
72 } else {
73 r1 = ret.Error(1)
74 }
75 return r0, r1
76}
77
78// MockBackupStorage_ApplyRetention_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ApplyRetention'
79type MockBackupStorage_ApplyRetention_Call struct {
80 *mock.Call
81}
82
83// ApplyRetention is a helper method to define mock.On call
84// - ctx context.Context
85// - app string
86// - policy domain.DatabaseBackupRetentionPolicy
87func (_e *MockBackupStorage_Expecter) ApplyRetention(ctx any, app any, policy any) *MockBackupStorage_ApplyRetention_Call {
88 return &MockBackupStorage_ApplyRetention_Call{Call: _e.mock.On("ApplyRetention", ctx, app, policy)}
89}
90
91func (_c *MockBackupStorage_ApplyRetention_Call) Run(run func(ctx context.Context, app string, policy domain.DatabaseBackupRetentionPolicy)) *MockBackupStorage_ApplyRetention_Call {
92 _c.Call.Run(func(args mock.Arguments) {
93 var arg0 context.Context
94 if args[0] != nil {
95 arg0 = args[0].(context.Context)
96 }
97 var arg1 string
98 if args[1] != nil {
99 arg1 = args[1].(string)
100 }
101 var arg2 domain.DatabaseBackupRetentionPolicy
102 if args[2] != nil {
103 arg2 = args[2].(domain.DatabaseBackupRetentionPolicy)
104 }
105 run(
106 arg0,
107 arg1,
108 arg2,
109 )
110 })
111 return _c
112}
113
114func (_c *MockBackupStorage_ApplyRetention_Call) Return(n int, err error) *MockBackupStorage_ApplyRetention_Call {
115 _c.Call.Return(n, err)
116 return _c
117}
118
119func (_c *MockBackupStorage_ApplyRetention_Call) RunAndReturn(run func(ctx context.Context, app string, policy domain.DatabaseBackupRetentionPolicy) (int, error)) *MockBackupStorage_ApplyRetention_Call {
120 _c.Call.Return(run)
121 return _c
122}
123
124// Delete provides a mock function for the type MockBackupStorage
125func (_mock *MockBackupStorage) Delete(ctx context.Context, path string) error {
126 ret := _mock.Called(ctx, path)
127
128 if len(ret) == 0 {
129 panic("no return value specified for Delete")
130 }
131
132 var r0 error
133 if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
134 r0 = returnFunc(ctx, path)
135 } else {
136 r0 = ret.Error(0)
137 }
138 return r0
139}
140
141// MockBackupStorage_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
142type MockBackupStorage_Delete_Call struct {
143 *mock.Call
144}
145
146// Delete is a helper method to define mock.On call
147// - ctx context.Context
148// - path string
149func (_e *MockBackupStorage_Expecter) Delete(ctx any, path any) *MockBackupStorage_Delete_Call {
150 return &MockBackupStorage_Delete_Call{Call: _e.mock.On("Delete", ctx, path)}
151}
152
153func (_c *MockBackupStorage_Delete_Call) Run(run func(ctx context.Context, path string)) *MockBackupStorage_Delete_Call {
154 _c.Call.Run(func(args mock.Arguments) {
155 var arg0 context.Context
156 if args[0] != nil {
157 arg0 = args[0].(context.Context)
158 }
159 var arg1 string
160 if args[1] != nil {
161 arg1 = args[1].(string)
162 }
163 run(
164 arg0,
165 arg1,
166 )
167 })
168 return _c
169}
170
171func (_c *MockBackupStorage_Delete_Call) Return(err error) *MockBackupStorage_Delete_Call {
172 _c.Call.Return(err)
173 return _c
174}
175
176func (_c *MockBackupStorage_Delete_Call) RunAndReturn(run func(ctx context.Context, path string) error) *MockBackupStorage_Delete_Call {
177 _c.Call.Return(run)
178 return _c
179}
180
181// Get provides a mock function for the type MockBackupStorage
182func (_mock *MockBackupStorage) Get(ctx context.Context, path string) (io.ReadCloser, error) {
183 ret := _mock.Called(ctx, path)
184
185 if len(ret) == 0 {
186 panic("no return value specified for Get")
187 }
188
189 var r0 io.ReadCloser
190 var r1 error
191 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (io.ReadCloser, error)); ok {
192 return returnFunc(ctx, path)
193 }
194 if returnFunc, ok := ret.Get(0).(func(context.Context, string) io.ReadCloser); ok {
195 r0 = returnFunc(ctx, path)
196 } else {
197 if ret.Get(0) != nil {
198 r0 = ret.Get(0).(io.ReadCloser)
199 }
200 }
201 if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
202 r1 = returnFunc(ctx, path)
203 } else {
204 r1 = ret.Error(1)
205 }
206 return r0, r1
207}
208
209// MockBackupStorage_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
210type MockBackupStorage_Get_Call struct {
211 *mock.Call
212}
213
214// Get is a helper method to define mock.On call
215// - ctx context.Context
216// - path string
217func (_e *MockBackupStorage_Expecter) Get(ctx any, path any) *MockBackupStorage_Get_Call {
218 return &MockBackupStorage_Get_Call{Call: _e.mock.On("Get", ctx, path)}
219}
220
221func (_c *MockBackupStorage_Get_Call) Run(run func(ctx context.Context, path string)) *MockBackupStorage_Get_Call {
222 _c.Call.Run(func(args mock.Arguments) {
223 var arg0 context.Context
224 if args[0] != nil {
225 arg0 = args[0].(context.Context)
226 }
227 var arg1 string
228 if args[1] != nil {
229 arg1 = args[1].(string)
230 }
231 run(
232 arg0,
233 arg1,
234 )
235 })
236 return _c
237}
238
239func (_c *MockBackupStorage_Get_Call) Return(readCloser io.ReadCloser, err error) *MockBackupStorage_Get_Call {
240 _c.Call.Return(readCloser, err)
241 return _c
242}
243
244func (_c *MockBackupStorage_Get_Call) RunAndReturn(run func(ctx context.Context, path string) (io.ReadCloser, error)) *MockBackupStorage_Get_Call {
245 _c.Call.Return(run)
246 return _c
247}
248
249// List provides a mock function for the type MockBackupStorage
250func (_mock *MockBackupStorage) List(ctx context.Context, app string, schedule *domain.BackupSchedule) ([]domain.DatabaseBackupJob, error) {
251 ret := _mock.Called(ctx, app, schedule)
252
253 if len(ret) == 0 {
254 panic("no return value specified for List")
255 }
256
257 var r0 []domain.DatabaseBackupJob
258 var r1 error
259 if returnFunc, ok := ret.Get(0).(func(context.Context, string, *domain.BackupSchedule) ([]domain.DatabaseBackupJob, error)); ok {
260 return returnFunc(ctx, app, schedule)
261 }
262 if returnFunc, ok := ret.Get(0).(func(context.Context, string, *domain.BackupSchedule) []domain.DatabaseBackupJob); ok {
263 r0 = returnFunc(ctx, app, schedule)
264 } else {
265 if ret.Get(0) != nil {
266 r0 = ret.Get(0).([]domain.DatabaseBackupJob)
267 }
268 }
269 if returnFunc, ok := ret.Get(1).(func(context.Context, string, *domain.BackupSchedule) error); ok {
270 r1 = returnFunc(ctx, app, schedule)
271 } else {
272 r1 = ret.Error(1)
273 }
274 return r0, r1
275}
276
277// MockBackupStorage_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
278type MockBackupStorage_List_Call struct {
279 *mock.Call
280}
281
282// List is a helper method to define mock.On call
283// - ctx context.Context
284// - app string
285// - schedule *domain.BackupSchedule
286func (_e *MockBackupStorage_Expecter) List(ctx any, app any, schedule any) *MockBackupStorage_List_Call {
287 return &MockBackupStorage_List_Call{Call: _e.mock.On("List", ctx, app, schedule)}
288}
289
290func (_c *MockBackupStorage_List_Call) Run(run func(ctx context.Context, app string, schedule *domain.BackupSchedule)) *MockBackupStorage_List_Call {
291 _c.Call.Run(func(args mock.Arguments) {
292 var arg0 context.Context
293 if args[0] != nil {
294 arg0 = args[0].(context.Context)
295 }
296 var arg1 string
297 if args[1] != nil {
298 arg1 = args[1].(string)
299 }
300 var arg2 *domain.BackupSchedule
301 if args[2] != nil {
302 arg2 = args[2].(*domain.BackupSchedule)
303 }
304 run(
305 arg0,
306 arg1,
307 arg2,
308 )
309 })
310 return _c
311}
312
313func (_c *MockBackupStorage_List_Call) Return(databaseBackupJobs []domain.DatabaseBackupJob, err error) *MockBackupStorage_List_Call {
314 _c.Call.Return(databaseBackupJobs, err)
315 return _c
316}
317
318func (_c *MockBackupStorage_List_Call) RunAndReturn(run func(ctx context.Context, app string, schedule *domain.BackupSchedule) ([]domain.DatabaseBackupJob, error)) *MockBackupStorage_List_Call {
319 _c.Call.Return(run)
320 return _c
321}
322
323// Store provides a mock function for the type MockBackupStorage
324func (_mock *MockBackupStorage) Store(ctx context.Context, app string, service string, database string, schedule domain.BackupSchedule, timestamp time.Time, data io.Reader) (string, error) {
325 ret := _mock.Called(ctx, app, service, database, schedule, timestamp, data)
326
327 if len(ret) == 0 {
328 panic("no return value specified for Store")
329 }
330
331 var r0 string
332 var r1 error
333 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, domain.BackupSchedule, time.Time, io.Reader) (string, error)); ok {
334 return returnFunc(ctx, app, service, database, schedule, timestamp, data)
335 }
336 if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, domain.BackupSchedule, time.Time, io.Reader) string); ok {
337 r0 = returnFunc(ctx, app, service, database, schedule, timestamp, data)
338 } else {
339 r0 = ret.Get(0).(string)
340 }
341 if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, string, domain.BackupSchedule, time.Time, io.Reader) error); ok {
342 r1 = returnFunc(ctx, app, service, database, schedule, timestamp, data)
343 } else {
344 r1 = ret.Error(1)
345 }
346 return r0, r1
347}
348
349// MockBackupStorage_Store_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Store'
350type MockBackupStorage_Store_Call struct {
351 *mock.Call
352}
353
354// Store is a helper method to define mock.On call
355// - ctx context.Context
356// - app string
357// - service string
358// - database string
359// - schedule domain.BackupSchedule
360// - timestamp time.Time
361// - data io.Reader
362func (_e *MockBackupStorage_Expecter) Store(ctx any, app any, service any, database any, schedule any, timestamp any, data any) *MockBackupStorage_Store_Call {
363 return &MockBackupStorage_Store_Call{Call: _e.mock.On("Store", ctx, app, service, database, schedule, timestamp, data)}
364}
365
366func (_c *MockBackupStorage_Store_Call) Run(run func(ctx context.Context, app string, service string, database string, schedule domain.BackupSchedule, timestamp time.Time, data io.Reader)) *MockBackupStorage_Store_Call {
367 _c.Call.Run(func(args mock.Arguments) {
368 var arg0 context.Context
369 if args[0] != nil {
370 arg0 = args[0].(context.Context)
371 }
372 var arg1 string
373 if args[1] != nil {
374 arg1 = args[1].(string)
375 }
376 var arg2 string
377 if args[2] != nil {
378 arg2 = args[2].(string)
379 }
380 var arg3 string
381 if args[3] != nil {
382 arg3 = args[3].(string)
383 }
384 var arg4 domain.BackupSchedule
385 if args[4] != nil {
386 arg4 = args[4].(domain.BackupSchedule)
387 }
388 var arg5 time.Time
389 if args[5] != nil {
390 arg5 = args[5].(time.Time)
391 }
392 var arg6 io.Reader
393 if args[6] != nil {
394 arg6 = args[6].(io.Reader)
395 }
396 run(
397 arg0,
398 arg1,
399 arg2,
400 arg3,
401 arg4,
402 arg5,
403 arg6,
404 )
405 })
406 return _c
407}
408
409func (_c *MockBackupStorage_Store_Call) Return(s string, err error) *MockBackupStorage_Store_Call {
410 _c.Call.Return(s, err)
411 return _c
412}
413
414func (_c *MockBackupStorage_Store_Call) RunAndReturn(run func(ctx context.Context, app string, service string, database string, schedule domain.BackupSchedule, timestamp time.Time, data io.Reader) (string, error)) *MockBackupStorage_Store_Call {
415 _c.Call.Return(run)
416 return _c
417}