// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // 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. // The first argument is typically a *testing.T value. func NewWebSessionService(t interface { mock.TestingT Cleanup(func()) }) *WebSessionService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &WebSessionService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // WebSessionService is an autogenerated mock type for the WebSessionService type type WebSessionService struct { mock.Mock } type WebSessionService_Expecter struct { mock *mock.Mock } func (_m *WebSessionService) EXPECT() *WebSessionService_Expecter { return &WebSessionService_Expecter{mock: &_m.Mock} } // Login provides a mock function for the type WebSessionService func (_mock *WebSessionService) Login(ctx context.Context, nonce string) (string, time.Duration, error) { ret := _mock.Called(ctx, nonce) if len(ret) == 0 { panic("no return value specified for Login") } var r0 string var r1 time.Duration var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, time.Duration, error)); ok { return returnFunc(ctx, nonce) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok { r0 = returnFunc(ctx, nonce) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, string) time.Duration); ok { r1 = returnFunc(ctx, nonce) } else { r1 = ret.Get(1).(time.Duration) } if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { r2 = returnFunc(ctx, nonce) } else { r2 = ret.Error(2) } return r0, r1, r2 } // WebSessionService_Login_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Login' type WebSessionService_Login_Call struct { *mock.Call } // Login is a helper method to define mock.On call // - ctx context.Context // - nonce string func (_e *WebSessionService_Expecter) Login(ctx any, nonce any) *WebSessionService_Login_Call { return &WebSessionService_Login_Call{Call: _e.mock.On("Login", ctx, nonce)} } func (_c *WebSessionService_Login_Call) Run(run func(ctx context.Context, nonce string)) *WebSessionService_Login_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *WebSessionService_Login_Call) Return(token string, lifetime time.Duration, err error) *WebSessionService_Login_Call { _c.Call.Return(token, lifetime, err) return _c } func (_c *WebSessionService_Login_Call) RunAndReturn(run func(ctx context.Context, nonce string) (string, time.Duration, error)) *WebSessionService_Login_Call { _c.Call.Return(run) return _c } // LoginLinkValid provides a mock function for the type WebSessionService func (_mock *WebSessionService) LoginLinkValid(nonce string) bool { ret := _mock.Called(nonce) if len(ret) == 0 { panic("no return value specified for LoginLinkValid") } var r0 bool if returnFunc, ok := ret.Get(0).(func(string) bool); ok { r0 = returnFunc(nonce) } else { r0 = ret.Get(0).(bool) } return r0 } // WebSessionService_LoginLinkValid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoginLinkValid' type WebSessionService_LoginLinkValid_Call struct { *mock.Call } // LoginLinkValid is a helper method to define mock.On call // - nonce string func (_e *WebSessionService_Expecter) LoginLinkValid(nonce any) *WebSessionService_LoginLinkValid_Call { return &WebSessionService_LoginLinkValid_Call{Call: _e.mock.On("LoginLinkValid", nonce)} } func (_c *WebSessionService_LoginLinkValid_Call) Run(run func(nonce string)) *WebSessionService_LoginLinkValid_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 string if args[0] != nil { arg0 = args[0].(string) } run( arg0, ) }) return _c } func (_c *WebSessionService_LoginLinkValid_Call) Return(b bool) *WebSessionService_LoginLinkValid_Call { _c.Call.Return(b) return _c } func (_c *WebSessionService_LoginLinkValid_Call) RunAndReturn(run func(nonce string) bool) *WebSessionService_LoginLinkValid_Call { _c.Call.Return(run) return _c } // Verify provides a mock function for the type WebSessionService func (_mock *WebSessionService) Verify(ctx context.Context, token string) (domain.Principal, bool, error) { ret := _mock.Called(ctx, token) if len(ret) == 0 { panic("no return value specified for Verify") } var r0 domain.Principal var r1 bool var r2 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) (domain.Principal, bool, error)); ok { return returnFunc(ctx, token) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) domain.Principal); ok { r0 = returnFunc(ctx, token) } else { r0 = ret.Get(0).(domain.Principal) } if returnFunc, ok := ret.Get(1).(func(context.Context, string) bool); ok { r1 = returnFunc(ctx, token) } else { r1 = ret.Get(1).(bool) } if returnFunc, ok := ret.Get(2).(func(context.Context, string) error); ok { r2 = returnFunc(ctx, token) } else { r2 = ret.Error(2) } return r0, r1, r2 } // WebSessionService_Verify_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Verify' type WebSessionService_Verify_Call struct { *mock.Call } // Verify is a helper method to define mock.On call // - ctx context.Context // - token string func (_e *WebSessionService_Expecter) Verify(ctx any, token any) *WebSessionService_Verify_Call { return &WebSessionService_Verify_Call{Call: _e.mock.On("Verify", ctx, token)} } func (_c *WebSessionService_Verify_Call) Run(run func(ctx context.Context, token string)) *WebSessionService_Verify_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } var arg1 string if args[1] != nil { arg1 = args[1].(string) } run( arg0, arg1, ) }) return _c } func (_c *WebSessionService_Verify_Call) Return(owner domain.Principal, ok bool, err error) *WebSessionService_Verify_Call { _c.Call.Return(owner, ok, err) return _c } func (_c *WebSessionService_Verify_Call) RunAndReturn(run func(ctx context.Context, token string) (domain.Principal, bool, error)) *WebSessionService_Verify_Call { _c.Call.Return(run) return _c }