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