Service.go raw
1 // Code generated by mockery; DO NOT EDIT.
2 // github.com/vektra/mockery
3 // template: testify
4
5 package mocks
6
7 import (
8 "github.com/getAlby/hub/alby"
9 "github.com/getAlby/hub/config"
10 "github.com/getAlby/hub/events"
11 "github.com/getAlby/hub/lnclient"
12 "github.com/getAlby/hub/service"
13 "github.com/getAlby/hub/service/keys"
14 "github.com/getAlby/hub/swaps"
15 "github.com/getAlby/hub/transactions"
16 mock "github.com/stretchr/testify/mock"
17 "gorm.io/gorm"
18 )
19
20 // NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
21 // The first argument is typically a *testing.T value.
22 func NewMockService(t interface {
23 mock.TestingT
24 Cleanup(func())
25 }) *MockService {
26 mock := &MockService{}
27 mock.Mock.Test(t)
28
29 t.Cleanup(func() { mock.AssertExpectations(t) })
30
31 return mock
32 }
33
34 // MockService is an autogenerated mock type for the Service type
35 type MockService struct {
36 mock.Mock
37 }
38
39 type MockService_Expecter struct {
40 mock *mock.Mock
41 }
42
43 func (_m *MockService) EXPECT() *MockService_Expecter {
44 return &MockService_Expecter{mock: &_m.Mock}
45 }
46
47 // GetAlbyOAuthSvc provides a mock function for the type MockService
48 func (_mock *MockService) GetAlbyOAuthSvc() alby.AlbyOAuthService {
49 ret := _mock.Called()
50
51 if len(ret) == 0 {
52 panic("no return value specified for GetAlbyOAuthSvc")
53 }
54
55 var r0 alby.AlbyOAuthService
56 if returnFunc, ok := ret.Get(0).(func() alby.AlbyOAuthService); ok {
57 r0 = returnFunc()
58 } else {
59 if ret.Get(0) != nil {
60 r0 = ret.Get(0).(alby.AlbyOAuthService)
61 }
62 }
63 return r0
64 }
65
66 // MockService_GetAlbyOAuthSvc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAlbyOAuthSvc'
67 type MockService_GetAlbyOAuthSvc_Call struct {
68 *mock.Call
69 }
70
71 // GetAlbyOAuthSvc is a helper method to define mock.On call
72 func (_e *MockService_Expecter) GetAlbyOAuthSvc() *MockService_GetAlbyOAuthSvc_Call {
73 return &MockService_GetAlbyOAuthSvc_Call{Call: _e.mock.On("GetAlbyOAuthSvc")}
74 }
75
76 func (_c *MockService_GetAlbyOAuthSvc_Call) Run(run func()) *MockService_GetAlbyOAuthSvc_Call {
77 _c.Call.Run(func(args mock.Arguments) {
78 run()
79 })
80 return _c
81 }
82
83 func (_c *MockService_GetAlbyOAuthSvc_Call) Return(albyOAuthService alby.AlbyOAuthService) *MockService_GetAlbyOAuthSvc_Call {
84 _c.Call.Return(albyOAuthService)
85 return _c
86 }
87
88 func (_c *MockService_GetAlbyOAuthSvc_Call) RunAndReturn(run func() alby.AlbyOAuthService) *MockService_GetAlbyOAuthSvc_Call {
89 _c.Call.Return(run)
90 return _c
91 }
92
93 // GetAlbySvc provides a mock function for the type MockService
94 func (_mock *MockService) GetAlbySvc() alby.AlbyService {
95 ret := _mock.Called()
96
97 if len(ret) == 0 {
98 panic("no return value specified for GetAlbySvc")
99 }
100
101 var r0 alby.AlbyService
102 if returnFunc, ok := ret.Get(0).(func() alby.AlbyService); ok {
103 r0 = returnFunc()
104 } else {
105 if ret.Get(0) != nil {
106 r0 = ret.Get(0).(alby.AlbyService)
107 }
108 }
109 return r0
110 }
111
112 // MockService_GetAlbySvc_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAlbySvc'
113 type MockService_GetAlbySvc_Call struct {
114 *mock.Call
115 }
116
117 // GetAlbySvc is a helper method to define mock.On call
118 func (_e *MockService_Expecter) GetAlbySvc() *MockService_GetAlbySvc_Call {
119 return &MockService_GetAlbySvc_Call{Call: _e.mock.On("GetAlbySvc")}
120 }
121
122 func (_c *MockService_GetAlbySvc_Call) Run(run func()) *MockService_GetAlbySvc_Call {
123 _c.Call.Run(func(args mock.Arguments) {
124 run()
125 })
126 return _c
127 }
128
129 func (_c *MockService_GetAlbySvc_Call) Return(albyService alby.AlbyService) *MockService_GetAlbySvc_Call {
130 _c.Call.Return(albyService)
131 return _c
132 }
133
134 func (_c *MockService_GetAlbySvc_Call) RunAndReturn(run func() alby.AlbyService) *MockService_GetAlbySvc_Call {
135 _c.Call.Return(run)
136 return _c
137 }
138
139 // GetConfig provides a mock function for the type MockService
140 func (_mock *MockService) GetConfig() config.Config {
141 ret := _mock.Called()
142
143 if len(ret) == 0 {
144 panic("no return value specified for GetConfig")
145 }
146
147 var r0 config.Config
148 if returnFunc, ok := ret.Get(0).(func() config.Config); ok {
149 r0 = returnFunc()
150 } else {
151 if ret.Get(0) != nil {
152 r0 = ret.Get(0).(config.Config)
153 }
154 }
155 return r0
156 }
157
158 // MockService_GetConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetConfig'
159 type MockService_GetConfig_Call struct {
160 *mock.Call
161 }
162
163 // GetConfig is a helper method to define mock.On call
164 func (_e *MockService_Expecter) GetConfig() *MockService_GetConfig_Call {
165 return &MockService_GetConfig_Call{Call: _e.mock.On("GetConfig")}
166 }
167
168 func (_c *MockService_GetConfig_Call) Run(run func()) *MockService_GetConfig_Call {
169 _c.Call.Run(func(args mock.Arguments) {
170 run()
171 })
172 return _c
173 }
174
175 func (_c *MockService_GetConfig_Call) Return(config1 config.Config) *MockService_GetConfig_Call {
176 _c.Call.Return(config1)
177 return _c
178 }
179
180 func (_c *MockService_GetConfig_Call) RunAndReturn(run func() config.Config) *MockService_GetConfig_Call {
181 _c.Call.Return(run)
182 return _c
183 }
184
185 // GetDB provides a mock function for the type MockService
186 func (_mock *MockService) GetDB() *gorm.DB {
187 ret := _mock.Called()
188
189 if len(ret) == 0 {
190 panic("no return value specified for GetDB")
191 }
192
193 var r0 *gorm.DB
194 if returnFunc, ok := ret.Get(0).(func() *gorm.DB); ok {
195 r0 = returnFunc()
196 } else {
197 if ret.Get(0) != nil {
198 r0 = ret.Get(0).(*gorm.DB)
199 }
200 }
201 return r0
202 }
203
204 // MockService_GetDB_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetDB'
205 type MockService_GetDB_Call struct {
206 *mock.Call
207 }
208
209 // GetDB is a helper method to define mock.On call
210 func (_e *MockService_Expecter) GetDB() *MockService_GetDB_Call {
211 return &MockService_GetDB_Call{Call: _e.mock.On("GetDB")}
212 }
213
214 func (_c *MockService_GetDB_Call) Run(run func()) *MockService_GetDB_Call {
215 _c.Call.Run(func(args mock.Arguments) {
216 run()
217 })
218 return _c
219 }
220
221 func (_c *MockService_GetDB_Call) Return(dB *gorm.DB) *MockService_GetDB_Call {
222 _c.Call.Return(dB)
223 return _c
224 }
225
226 func (_c *MockService_GetDB_Call) RunAndReturn(run func() *gorm.DB) *MockService_GetDB_Call {
227 _c.Call.Return(run)
228 return _c
229 }
230
231 // GetEventPublisher provides a mock function for the type MockService
232 func (_mock *MockService) GetEventPublisher() events.EventPublisher {
233 ret := _mock.Called()
234
235 if len(ret) == 0 {
236 panic("no return value specified for GetEventPublisher")
237 }
238
239 var r0 events.EventPublisher
240 if returnFunc, ok := ret.Get(0).(func() events.EventPublisher); ok {
241 r0 = returnFunc()
242 } else {
243 if ret.Get(0) != nil {
244 r0 = ret.Get(0).(events.EventPublisher)
245 }
246 }
247 return r0
248 }
249
250 // MockService_GetEventPublisher_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventPublisher'
251 type MockService_GetEventPublisher_Call struct {
252 *mock.Call
253 }
254
255 // GetEventPublisher is a helper method to define mock.On call
256 func (_e *MockService_Expecter) GetEventPublisher() *MockService_GetEventPublisher_Call {
257 return &MockService_GetEventPublisher_Call{Call: _e.mock.On("GetEventPublisher")}
258 }
259
260 func (_c *MockService_GetEventPublisher_Call) Run(run func()) *MockService_GetEventPublisher_Call {
261 _c.Call.Run(func(args mock.Arguments) {
262 run()
263 })
264 return _c
265 }
266
267 func (_c *MockService_GetEventPublisher_Call) Return(eventPublisher events.EventPublisher) *MockService_GetEventPublisher_Call {
268 _c.Call.Return(eventPublisher)
269 return _c
270 }
271
272 func (_c *MockService_GetEventPublisher_Call) RunAndReturn(run func() events.EventPublisher) *MockService_GetEventPublisher_Call {
273 _c.Call.Return(run)
274 return _c
275 }
276
277 // GetKeys provides a mock function for the type MockService
278 func (_mock *MockService) GetKeys() keys.Keys {
279 ret := _mock.Called()
280
281 if len(ret) == 0 {
282 panic("no return value specified for GetKeys")
283 }
284
285 var r0 keys.Keys
286 if returnFunc, ok := ret.Get(0).(func() keys.Keys); ok {
287 r0 = returnFunc()
288 } else {
289 if ret.Get(0) != nil {
290 r0 = ret.Get(0).(keys.Keys)
291 }
292 }
293 return r0
294 }
295
296 // MockService_GetKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeys'
297 type MockService_GetKeys_Call struct {
298 *mock.Call
299 }
300
301 // GetKeys is a helper method to define mock.On call
302 func (_e *MockService_Expecter) GetKeys() *MockService_GetKeys_Call {
303 return &MockService_GetKeys_Call{Call: _e.mock.On("GetKeys")}
304 }
305
306 func (_c *MockService_GetKeys_Call) Run(run func()) *MockService_GetKeys_Call {
307 _c.Call.Run(func(args mock.Arguments) {
308 run()
309 })
310 return _c
311 }
312
313 func (_c *MockService_GetKeys_Call) Return(keys1 keys.Keys) *MockService_GetKeys_Call {
314 _c.Call.Return(keys1)
315 return _c
316 }
317
318 func (_c *MockService_GetKeys_Call) RunAndReturn(run func() keys.Keys) *MockService_GetKeys_Call {
319 _c.Call.Return(run)
320 return _c
321 }
322
323 // GetLNClient provides a mock function for the type MockService
324 func (_mock *MockService) GetLNClient() lnclient.LNClient {
325 ret := _mock.Called()
326
327 if len(ret) == 0 {
328 panic("no return value specified for GetLNClient")
329 }
330
331 var r0 lnclient.LNClient
332 if returnFunc, ok := ret.Get(0).(func() lnclient.LNClient); ok {
333 r0 = returnFunc()
334 } else {
335 if ret.Get(0) != nil {
336 r0 = ret.Get(0).(lnclient.LNClient)
337 }
338 }
339 return r0
340 }
341
342 // MockService_GetLNClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLNClient'
343 type MockService_GetLNClient_Call struct {
344 *mock.Call
345 }
346
347 // GetLNClient is a helper method to define mock.On call
348 func (_e *MockService_Expecter) GetLNClient() *MockService_GetLNClient_Call {
349 return &MockService_GetLNClient_Call{Call: _e.mock.On("GetLNClient")}
350 }
351
352 func (_c *MockService_GetLNClient_Call) Run(run func()) *MockService_GetLNClient_Call {
353 _c.Call.Run(func(args mock.Arguments) {
354 run()
355 })
356 return _c
357 }
358
359 func (_c *MockService_GetLNClient_Call) Return(lNClient lnclient.LNClient) *MockService_GetLNClient_Call {
360 _c.Call.Return(lNClient)
361 return _c
362 }
363
364 func (_c *MockService_GetLNClient_Call) RunAndReturn(run func() lnclient.LNClient) *MockService_GetLNClient_Call {
365 _c.Call.Return(run)
366 return _c
367 }
368
369 // GetRelayStatuses provides a mock function for the type MockService
370 func (_mock *MockService) GetRelayStatuses() []service.RelayStatus {
371 ret := _mock.Called()
372
373 if len(ret) == 0 {
374 panic("no return value specified for GetRelayStatuses")
375 }
376
377 var r0 []service.RelayStatus
378 if returnFunc, ok := ret.Get(0).(func() []service.RelayStatus); ok {
379 r0 = returnFunc()
380 } else {
381 if ret.Get(0) != nil {
382 r0 = ret.Get(0).([]service.RelayStatus)
383 }
384 }
385 return r0
386 }
387
388 // MockService_GetRelayStatuses_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRelayStatuses'
389 type MockService_GetRelayStatuses_Call struct {
390 *mock.Call
391 }
392
393 // GetRelayStatuses is a helper method to define mock.On call
394 func (_e *MockService_Expecter) GetRelayStatuses() *MockService_GetRelayStatuses_Call {
395 return &MockService_GetRelayStatuses_Call{Call: _e.mock.On("GetRelayStatuses")}
396 }
397
398 func (_c *MockService_GetRelayStatuses_Call) Run(run func()) *MockService_GetRelayStatuses_Call {
399 _c.Call.Run(func(args mock.Arguments) {
400 run()
401 })
402 return _c
403 }
404
405 func (_c *MockService_GetRelayStatuses_Call) Return(relayStatuss []service.RelayStatus) *MockService_GetRelayStatuses_Call {
406 _c.Call.Return(relayStatuss)
407 return _c
408 }
409
410 func (_c *MockService_GetRelayStatuses_Call) RunAndReturn(run func() []service.RelayStatus) *MockService_GetRelayStatuses_Call {
411 _c.Call.Return(run)
412 return _c
413 }
414
415 // GetStartupState provides a mock function for the type MockService
416 func (_mock *MockService) GetStartupState() string {
417 ret := _mock.Called()
418
419 if len(ret) == 0 {
420 panic("no return value specified for GetStartupState")
421 }
422
423 var r0 string
424 if returnFunc, ok := ret.Get(0).(func() string); ok {
425 r0 = returnFunc()
426 } else {
427 r0 = ret.Get(0).(string)
428 }
429 return r0
430 }
431
432 // MockService_GetStartupState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetStartupState'
433 type MockService_GetStartupState_Call struct {
434 *mock.Call
435 }
436
437 // GetStartupState is a helper method to define mock.On call
438 func (_e *MockService_Expecter) GetStartupState() *MockService_GetStartupState_Call {
439 return &MockService_GetStartupState_Call{Call: _e.mock.On("GetStartupState")}
440 }
441
442 func (_c *MockService_GetStartupState_Call) Run(run func()) *MockService_GetStartupState_Call {
443 _c.Call.Run(func(args mock.Arguments) {
444 run()
445 })
446 return _c
447 }
448
449 func (_c *MockService_GetStartupState_Call) Return(s string) *MockService_GetStartupState_Call {
450 _c.Call.Return(s)
451 return _c
452 }
453
454 func (_c *MockService_GetStartupState_Call) RunAndReturn(run func() string) *MockService_GetStartupState_Call {
455 _c.Call.Return(run)
456 return _c
457 }
458
459 // GetSwapsService provides a mock function for the type MockService
460 func (_mock *MockService) GetSwapsService() swaps.SwapsService {
461 ret := _mock.Called()
462
463 if len(ret) == 0 {
464 panic("no return value specified for GetSwapsService")
465 }
466
467 var r0 swaps.SwapsService
468 if returnFunc, ok := ret.Get(0).(func() swaps.SwapsService); ok {
469 r0 = returnFunc()
470 } else {
471 if ret.Get(0) != nil {
472 r0 = ret.Get(0).(swaps.SwapsService)
473 }
474 }
475 return r0
476 }
477
478 // MockService_GetSwapsService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSwapsService'
479 type MockService_GetSwapsService_Call struct {
480 *mock.Call
481 }
482
483 // GetSwapsService is a helper method to define mock.On call
484 func (_e *MockService_Expecter) GetSwapsService() *MockService_GetSwapsService_Call {
485 return &MockService_GetSwapsService_Call{Call: _e.mock.On("GetSwapsService")}
486 }
487
488 func (_c *MockService_GetSwapsService_Call) Run(run func()) *MockService_GetSwapsService_Call {
489 _c.Call.Run(func(args mock.Arguments) {
490 run()
491 })
492 return _c
493 }
494
495 func (_c *MockService_GetSwapsService_Call) Return(swapsService swaps.SwapsService) *MockService_GetSwapsService_Call {
496 _c.Call.Return(swapsService)
497 return _c
498 }
499
500 func (_c *MockService_GetSwapsService_Call) RunAndReturn(run func() swaps.SwapsService) *MockService_GetSwapsService_Call {
501 _c.Call.Return(run)
502 return _c
503 }
504
505 // GetTransactionsService provides a mock function for the type MockService
506 func (_mock *MockService) GetTransactionsService() transactions.TransactionsService {
507 ret := _mock.Called()
508
509 if len(ret) == 0 {
510 panic("no return value specified for GetTransactionsService")
511 }
512
513 var r0 transactions.TransactionsService
514 if returnFunc, ok := ret.Get(0).(func() transactions.TransactionsService); ok {
515 r0 = returnFunc()
516 } else {
517 if ret.Get(0) != nil {
518 r0 = ret.Get(0).(transactions.TransactionsService)
519 }
520 }
521 return r0
522 }
523
524 // MockService_GetTransactionsService_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTransactionsService'
525 type MockService_GetTransactionsService_Call struct {
526 *mock.Call
527 }
528
529 // GetTransactionsService is a helper method to define mock.On call
530 func (_e *MockService_Expecter) GetTransactionsService() *MockService_GetTransactionsService_Call {
531 return &MockService_GetTransactionsService_Call{Call: _e.mock.On("GetTransactionsService")}
532 }
533
534 func (_c *MockService_GetTransactionsService_Call) Run(run func()) *MockService_GetTransactionsService_Call {
535 _c.Call.Run(func(args mock.Arguments) {
536 run()
537 })
538 return _c
539 }
540
541 func (_c *MockService_GetTransactionsService_Call) Return(transactionsService transactions.TransactionsService) *MockService_GetTransactionsService_Call {
542 _c.Call.Return(transactionsService)
543 return _c
544 }
545
546 func (_c *MockService_GetTransactionsService_Call) RunAndReturn(run func() transactions.TransactionsService) *MockService_GetTransactionsService_Call {
547 _c.Call.Return(run)
548 return _c
549 }
550
551 // Shutdown provides a mock function for the type MockService
552 func (_mock *MockService) Shutdown() {
553 _mock.Called()
554 return
555 }
556
557 // MockService_Shutdown_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shutdown'
558 type MockService_Shutdown_Call struct {
559 *mock.Call
560 }
561
562 // Shutdown is a helper method to define mock.On call
563 func (_e *MockService_Expecter) Shutdown() *MockService_Shutdown_Call {
564 return &MockService_Shutdown_Call{Call: _e.mock.On("Shutdown")}
565 }
566
567 func (_c *MockService_Shutdown_Call) Run(run func()) *MockService_Shutdown_Call {
568 _c.Call.Run(func(args mock.Arguments) {
569 run()
570 })
571 return _c
572 }
573
574 func (_c *MockService_Shutdown_Call) Return() *MockService_Shutdown_Call {
575 _c.Call.Return()
576 return _c
577 }
578
579 func (_c *MockService_Shutdown_Call) RunAndReturn(run func()) *MockService_Shutdown_Call {
580 _c.Run(run)
581 return _c
582 }
583
584 // StartApp provides a mock function for the type MockService
585 func (_mock *MockService) StartApp(encryptionKey string) error {
586 ret := _mock.Called(encryptionKey)
587
588 if len(ret) == 0 {
589 panic("no return value specified for StartApp")
590 }
591
592 var r0 error
593 if returnFunc, ok := ret.Get(0).(func(string) error); ok {
594 r0 = returnFunc(encryptionKey)
595 } else {
596 r0 = ret.Error(0)
597 }
598 return r0
599 }
600
601 // MockService_StartApp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StartApp'
602 type MockService_StartApp_Call struct {
603 *mock.Call
604 }
605
606 // StartApp is a helper method to define mock.On call
607 // - encryptionKey string
608 func (_e *MockService_Expecter) StartApp(encryptionKey interface{}) *MockService_StartApp_Call {
609 return &MockService_StartApp_Call{Call: _e.mock.On("StartApp", encryptionKey)}
610 }
611
612 func (_c *MockService_StartApp_Call) Run(run func(encryptionKey string)) *MockService_StartApp_Call {
613 _c.Call.Run(func(args mock.Arguments) {
614 var arg0 string
615 if args[0] != nil {
616 arg0 = args[0].(string)
617 }
618 run(
619 arg0,
620 )
621 })
622 return _c
623 }
624
625 func (_c *MockService_StartApp_Call) Return(err error) *MockService_StartApp_Call {
626 _c.Call.Return(err)
627 return _c
628 }
629
630 func (_c *MockService_StartApp_Call) RunAndReturn(run func(encryptionKey string) error) *MockService_StartApp_Call {
631 _c.Call.Return(run)
632 return _c
633 }
634
635 // StopApp provides a mock function for the type MockService
636 func (_mock *MockService) StopApp() {
637 _mock.Called()
638 return
639 }
640
641 // MockService_StopApp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopApp'
642 type MockService_StopApp_Call struct {
643 *mock.Call
644 }
645
646 // StopApp is a helper method to define mock.On call
647 func (_e *MockService_Expecter) StopApp() *MockService_StopApp_Call {
648 return &MockService_StopApp_Call{Call: _e.mock.On("StopApp")}
649 }
650
651 func (_c *MockService_StopApp_Call) Run(run func()) *MockService_StopApp_Call {
652 _c.Call.Run(func(args mock.Arguments) {
653 run()
654 })
655 return _c
656 }
657
658 func (_c *MockService_StopApp_Call) Return() *MockService_StopApp_Call {
659 _c.Call.Return()
660 return _c
661 }
662
663 func (_c *MockService_StopApp_Call) RunAndReturn(run func()) *MockService_StopApp_Call {
664 _c.Run(run)
665 return _c
666 }
667