// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "bnema.dev/ermite/internal/domain" mock "github.com/stretchr/testify/mock" ) // 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. // The first argument is typically a *testing.T value. func NewAuthService(t interface { mock.TestingT Cleanup(func()) }) *AuthService { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock := &AuthService{} mock.Mock.Test(t) t.Cleanup(func() { if helper, ok := t.(interface{ Helper() }); ok { helper.Helper() } mock.AssertExpectations(t) }) return mock } // AuthService is an autogenerated mock type for the AuthService type type AuthService struct { mock.Mock } type AuthService_Expecter struct { mock *mock.Mock } func (_m *AuthService) EXPECT() *AuthService_Expecter { return &AuthService_Expecter{mock: &_m.Mock} } // Authenticate provides a mock function for the type AuthService func (_mock *AuthService) Authenticate(ctx context.Context, secret string) (domain.Principal, error) { ret := _mock.Called(ctx, secret) if len(ret) == 0 { panic("no return value specified for Authenticate") } var r0 domain.Principal var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) (domain.Principal, error)); ok { return returnFunc(ctx, secret) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) domain.Principal); ok { r0 = returnFunc(ctx, secret) } else { r0 = ret.Get(0).(domain.Principal) } if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = returnFunc(ctx, secret) } else { r1 = ret.Error(1) } return r0, r1 } // AuthService_Authenticate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Authenticate' type AuthService_Authenticate_Call struct { *mock.Call } // Authenticate is a helper method to define mock.On call // - ctx context.Context // - secret string func (_e *AuthService_Expecter) Authenticate(ctx any, secret any) *AuthService_Authenticate_Call { return &AuthService_Authenticate_Call{Call: _e.mock.On("Authenticate", ctx, secret)} } func (_c *AuthService_Authenticate_Call) Run(run func(ctx context.Context, secret string)) *AuthService_Authenticate_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 *AuthService_Authenticate_Call) Return(principal domain.Principal, err error) *AuthService_Authenticate_Call { _c.Call.Return(principal, err) return _c } func (_c *AuthService_Authenticate_Call) RunAndReturn(run func(ctx context.Context, secret string) (domain.Principal, error)) *AuthService_Authenticate_Call { _c.Call.Return(run) return _c }