1// Code generated by mockery; DO NOT EDIT.
2// github.com/vektra/mockery
3// template: testify
4
5package mocks
6
7import (
8 "context"
9 "time"
10
11 "bnema.dev/ermite/internal/domain"
12 mock "github.com/stretchr/testify/mock"
13)
14
15// NewWebSessionService creates a new instance of WebSessionService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
16// The first argument is typically a *testing.T value.
17func NewWebSessionService(t interface {
18 mock.TestingT
19 Cleanup(func())
20}) *WebSessionService {
21 if helper, ok := t.(interface{ Helper() }); ok {
22 helper.Helper()
23 }
24
25 mock := &WebSessionService{}
26 mock.Mock.Test(t)
27
28 t.Cleanup(func() {
29 if helper, ok := t.(interface{ Helper() }); ok {
30 helper.Helper()
31 }
32 mock.AssertExpectations(t)
33 })
34
35 return mock
36}
37
38// WebSessionService is an autogenerated mock type for the WebSessionService type
39type WebSessionService struct {
40 mock.Mock
41}
42
43type WebSessionService_Expecter struct {
44 mock *mock.Mock
45}
46
47func (_m *WebSessionService) EXPECT() *WebSessionService_Expecter {
48 return &WebSessionService_Expecter{mock: &_m.Mock}
49}
50
51// Login provides a mock function for the type WebSessionService
52func (_mock *WebSessionService) Login(ctx context.Context, nonce string) (string, time.Duration, error) {
53 ret := _mock.Called(ctx, nonce)
54
55 if len(ret) == 0 {
56 panic("no return value specified for Login")
57 }
58
59 var r0 string
60 var r1 time.Duration
61 var r2 error
62 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, time.Duration, error)); ok {
63 return returnFunc(ctx, nonce)
64 }
65 if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok {
66 r0 = returnFunc(ctx, nonce)
67 } else {
68 r0 = ret.Get(0).(string)
69 }
70 if returnFunc, ok := ret.Get(1).(func(context.Context, string) time.Duration); ok {
71 r1 = returnFunc(ctx, nonce)
72 } else {
73 r1 = ret.Get(1).(time.Duration)
74 }
75 if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok {
76 r2 = returnFunc(ctx, nonce)
77 } else {
78 r2 = ret.Error(2)
79 }
80 return r0, r1, r2
81}
82
83// WebSessionService_Login_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Login'
84type WebSessionService_Login_Call struct {
85 *mock.Call
86}
87
88// Login is a helper method to define mock.On call
89// - ctx context.Context
90// - nonce string
91func (_e *WebSessionService_Expecter) Login(ctx any, nonce any) *WebSessionService_Login_Call {
92 return &WebSessionService_Login_Call{Call: _e.mock.On("Login", ctx, nonce)}
93}
94
95func (_c *WebSessionService_Login_Call) Run(run func(ctx context.Context, nonce string)) *WebSessionService_Login_Call {
96 _c.Call.Run(func(args mock.Arguments) {
97 var arg0 context.Context
98 if args[0] != nil {
99 arg0 = args[0].(context.Context)
100 }
101 var arg1 string
102 if args[1] != nil {
103 arg1 = args[1].(string)
104 }
105 run(
106 arg0,
107 arg1,
108 )
109 })
110 return _c
111}
112
113func (_c *WebSessionService_Login_Call) Return(token string, lifetime time.Duration, err error) *WebSessionService_Login_Call {
114 _c.Call.Return(token, lifetime, err)
115 return _c
116}
117
118func (_c *WebSessionService_Login_Call) RunAndReturn(run func(ctx context.Context, nonce string) (string, time.Duration, error)) *WebSessionService_Login_Call {
119 _c.Call.Return(run)
120 return _c
121}
122
123// LoginLinkValid provides a mock function for the type WebSessionService
124func (_mock *WebSessionService) LoginLinkValid(nonce string) bool {
125 ret := _mock.Called(nonce)
126
127 if len(ret) == 0 {
128 panic("no return value specified for LoginLinkValid")
129 }
130
131 var r0 bool
132 if returnFunc, ok := ret.Get(0).(func(string) bool); ok {
133 r0 = returnFunc(nonce)
134 } else {
135 r0 = ret.Get(0).(bool)
136 }
137 return r0
138}
139
140// WebSessionService_LoginLinkValid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoginLinkValid'
141type WebSessionService_LoginLinkValid_Call struct {
142 *mock.Call
143}
144
145// LoginLinkValid is a helper method to define mock.On call
146// - nonce string
147func (_e *WebSessionService_Expecter) LoginLinkValid(nonce any) *WebSessionService_LoginLinkValid_Call {
148 return &WebSessionService_LoginLinkValid_Call{Call: _e.mock.On("LoginLinkValid", nonce)}
149}
150
151func (_c *WebSessionService_LoginLinkValid_Call) Run(run func(nonce string)) *WebSessionService_LoginLinkValid_Call {
152 _c.Call.Run(func(args mock.Arguments) {
153 var arg0 string
154 if args[0] != nil {
155 arg0 = args[0].(string)
156 }
157 run(
158 arg0,
159 )
160 })
161 return _c
162}
163
164func (_c *WebSessionService_LoginLinkValid_Call) Return(b bool) *WebSessionService_LoginLinkValid_Call {
165 _c.Call.Return(b)
166 return _c
167}
168
169func (_c *WebSessionService_LoginLinkValid_Call) RunAndReturn(run func(nonce string) bool) *WebSessionService_LoginLinkValid_Call {
170 _c.Call.Return(run)
171 return _c
172}
173
174// Verify provides a mock function for the type WebSessionService
175func (_mock *WebSessionService) Verify(ctx context.Context, token string) (domain.Principal, bool, error) {
176 ret := _mock.Called(ctx, token)
177
178 if len(ret) == 0 {
179 panic("no return value specified for Verify")
180 }
181
182 var r0 domain.Principal
183 var r1 bool
184 var r2 error
185 if returnFunc, ok := ret.Get(0).(func(context.Context, string) (domain.Principal, bool, error)); ok {
186 return returnFunc(ctx, token)
187 }
188 if returnFunc, ok := ret.Get(0).(func(context.Context, string) domain.Principal); ok {
189 r0 = returnFunc(ctx, token)
190 } else {
191 r0 = ret.Get(0).(domain.Principal)
192 }
193 if returnFunc, ok := ret.Get(1).(func(context.Context, string) bool); ok {
194 r1 = returnFunc(ctx, token)
195 } else {
196 r1 = ret.Get(1).(bool)
197 }
198 if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok {
199 r2 = returnFunc(ctx, token)
200 } else {
201 r2 = ret.Error(2)
202 }
203 return r0, r1, r2
204}
205
206// WebSessionService_Verify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Verify'
207type WebSessionService_Verify_Call struct {
208 *mock.Call
209}
210
211// Verify is a helper method to define mock.On call
212// - ctx context.Context
213// - token string
214func (_e *WebSessionService_Expecter) Verify(ctx any, token any) *WebSessionService_Verify_Call {
215 return &WebSessionService_Verify_Call{Call: _e.mock.On("Verify", ctx, token)}
216}
217
218func (_c *WebSessionService_Verify_Call) Run(run func(ctx context.Context, token string)) *WebSessionService_Verify_Call {
219 _c.Call.Run(func(args mock.Arguments) {
220 var arg0 context.Context
221 if args[0] != nil {
222 arg0 = args[0].(context.Context)
223 }
224 var arg1 string
225 if args[1] != nil {
226 arg1 = args[1].(string)
227 }
228 run(
229 arg0,
230 arg1,
231 )
232 })
233 return _c
234}
235
236func (_c *WebSessionService_Verify_Call) Return(owner domain.Principal, ok bool, err error) *WebSessionService_Verify_Call {
237 _c.Call.Return(owner, ok, err)
238 return _c
239}
240
241func (_c *WebSessionService_Verify_Call) RunAndReturn(run func(ctx context.Context, token string) (domain.Principal, bool, error)) *WebSessionService_Verify_Call {
242 _c.Call.Return(run)
243 return _c
244}