AuthService.go RawHistoryFolder
1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9
10 "bnema.dev/ermite/internal/domain"
11 mock "github.com/stretchr/testify/mock"
12)
13
14// NewAuthService creates a new instance of AuthService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
15// The first argument is typically a *testing.T value.
16func NewAuthService(t interface {
17 mock.TestingT
18 Cleanup(func())
19}) *AuthService {
20 if helper, ok := t.(interface{ Helper() }); ok {
21 helper.Helper()
22 }
23
24 mock := &AuthService{}
25 mock.Mock.Test(t)
26
27 t.Cleanup(func() {
28 if helper, ok := t.(interface{ Helper() }); ok {
29 helper.Helper()
30 }
31 mock.AssertExpectations(t)
32 })
33
34 return mock
35}
36
37// AuthService is an autogenerated mock type for the AuthService type
38type AuthService struct {
39 mock.Mock
40}
41
42type AuthService_Expecter struct {
43 mock *mock.Mock
44}
45
46func (_m *AuthService) EXPECT() *AuthService_Expecter {
47 return &AuthService_Expecter{mock: &_m.Mock}
48}
49
50// Authenticate provides a mock function for the type AuthService
51func (_mock *AuthService) Authenticate(ctx context.Context, secret string) (domain.Principal, error) {
52 ret := _mock.Called(ctx, secret)
53
54 if len(ret) == 0 {
55 panic("no return value specified for Authenticate")
56 }
57
58 var r0 domain.Principal
59 var r1 error
60 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (domain.Principal, error)); ok {
61 return returnFunc(ctx, secret)
62 }
63 if returnFunc, ok := ret.Get(0).(func(context.Context, string) domain.Principal); ok {
64 r0 = returnFunc(ctx, secret)
65 } else {
66 r0 = ret.Get(0).(domain.Principal)
67 }
68 if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
69 r1 = returnFunc(ctx, secret)
70 } else {
71 r1 = ret.Error(1)
72 }
73 return r0, r1
74}
75
76// AuthService_Authenticate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Authenticate'
77type AuthService_Authenticate_Call struct {
78 *mock.Call
79}
80
81// Authenticate is a helper method to define mock.On call
82// - ctx context.Context
83// - secret string
84func (_e *AuthService_Expecter) Authenticate(ctx any, secret any) *AuthService_Authenticate_Call {
85 return &AuthService_Authenticate_Call{Call: _e.mock.On("Authenticate", ctx, secret)}
86}
87
88func (_c *AuthService_Authenticate_Call) Run(run func(ctx context.Context, secret string)) *AuthService_Authenticate_Call {
89 _c.Call.Run(func(args mock.Arguments) {
90 var arg0 context.Context
91 if args[0] != nil {
92 arg0 = args[0].(context.Context)
93 }
94 var arg1 string
95 if args[1] != nil {
96 arg1 = args[1].(string)
97 }
98 run(
99 arg0,
100 arg1,
101 )
102 })
103 return _c
104}
105
106func (_c *AuthService_Authenticate_Call) Return(principal domain.Principal, err error) *AuthService_Authenticate_Call {
107 _c.Call.Return(principal, err)
108 return _c
109}
110
111func (_c *AuthService_Authenticate_Call) RunAndReturn(run func(ctx context.Context, secret string) (domain.Principal, error)) *AuthService_Authenticate_Call {
112 _c.Call.Return(run)
113 return _c
114}