// Code generated by mockery; DO NOT EDIT. // github.com/vektra/mockery // template: testify package mocks import ( "context" "time" "github.com/bnema/gordon/internal/domain" mock "github.com/stretchr/testify/mock" ) // NewMockAuthService creates a new instance of MockAuthService. 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 NewMockAuthService(t interface { mock.TestingT Cleanup(func()) }) *MockAuthService { mock := &MockAuthService{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock } // MockAuthService is an autogenerated mock type for the AuthService type type MockAuthService struct { mock.Mock } type MockAuthService_Expecter struct { mock *mock.Mock } func (_m *MockAuthService) EXPECT() *MockAuthService_Expecter { return &MockAuthService_Expecter{mock: &_m.Mock} } // GenerateAccessToken provides a mock function for the type MockAuthService func (_mock *MockAuthService) GenerateAccessToken(ctx context.Context, subject string, scopes []string, expiry time.Duration) (string, error) { ret := _mock.Called(ctx, subject, scopes, expiry) if len(ret) == 0 { panic("no return value specified for GenerateAccessToken") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, time.Duration) (string, error)); ok { return returnFunc(ctx, subject, scopes, expiry) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, time.Duration) string); ok { r0 = returnFunc(ctx, subject, scopes, expiry) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, string, []string, time.Duration) error); ok { r1 = returnFunc(ctx, subject, scopes, expiry) } else { r1 = ret.Error(1) } return r0, r1 } // MockAuthService_GenerateAccessToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateAccessToken' type MockAuthService_GenerateAccessToken_Call struct { *mock.Call } // GenerateAccessToken is a helper method to define mock.On call // - ctx context.Context // - subject string // - scopes []string // - expiry time.Duration func (_e *MockAuthService_Expecter) GenerateAccessToken(ctx interface{}, subject interface{}, scopes interface{}, expiry interface{}) *MockAuthService_GenerateAccessToken_Call { return &MockAuthService_GenerateAccessToken_Call{Call: _e.mock.On("GenerateAccessToken", ctx, subject, scopes, expiry)} } func (_c *MockAuthService_GenerateAccessToken_Call) Run(run func(ctx context.Context, subject string, scopes []string, expiry time.Duration)) *MockAuthService_GenerateAccessToken_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) } var arg2 []string if args[2] != nil { arg2 = args[2].([]string) } var arg3 time.Duration if args[3] != nil { arg3 = args[3].(time.Duration) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MockAuthService_GenerateAccessToken_Call) Return(s string, err error) *MockAuthService_GenerateAccessToken_Call { _c.Call.Return(s, err) return _c } func (_c *MockAuthService_GenerateAccessToken_Call) RunAndReturn(run func(ctx context.Context, subject string, scopes []string, expiry time.Duration) (string, error)) *MockAuthService_GenerateAccessToken_Call { _c.Call.Return(run) return _c } // GeneratePasswordHash provides a mock function for the type MockAuthService func (_mock *MockAuthService) GeneratePasswordHash(password string) (string, error) { ret := _mock.Called(password) if len(ret) == 0 { panic("no return value specified for GeneratePasswordHash") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(string) (string, error)); ok { return returnFunc(password) } if returnFunc, ok := ret.Get(0).(func(string) string); ok { r0 = returnFunc(password) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(string) error); ok { r1 = returnFunc(password) } else { r1 = ret.Error(1) } return r0, r1 } // MockAuthService_GeneratePasswordHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GeneratePasswordHash' type MockAuthService_GeneratePasswordHash_Call struct { *mock.Call } // GeneratePasswordHash is a helper method to define mock.On call // - password string func (_e *MockAuthService_Expecter) GeneratePasswordHash(password interface{}) *MockAuthService_GeneratePasswordHash_Call { return &MockAuthService_GeneratePasswordHash_Call{Call: _e.mock.On("GeneratePasswordHash", password)} } func (_c *MockAuthService_GeneratePasswordHash_Call) Run(run func(password string)) *MockAuthService_GeneratePasswordHash_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 *MockAuthService_GeneratePasswordHash_Call) Return(s string, err error) *MockAuthService_GeneratePasswordHash_Call { _c.Call.Return(s, err) return _c } func (_c *MockAuthService_GeneratePasswordHash_Call) RunAndReturn(run func(password string) (string, error)) *MockAuthService_GeneratePasswordHash_Call { _c.Call.Return(run) return _c } // GenerateToken provides a mock function for the type MockAuthService func (_mock *MockAuthService) GenerateToken(ctx context.Context, subject string, scopes []string, expiry time.Duration) (string, error) { ret := _mock.Called(ctx, subject, scopes, expiry) if len(ret) == 0 { panic("no return value specified for GenerateToken") } var r0 string var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, time.Duration) (string, error)); ok { return returnFunc(ctx, subject, scopes, expiry) } if returnFunc, ok := ret.Get(0).(func(context.Context, string, []string, time.Duration) string); ok { r0 = returnFunc(ctx, subject, scopes, expiry) } else { r0 = ret.Get(0).(string) } if returnFunc, ok := ret.Get(1).(func(context.Context, string, []string, time.Duration) error); ok { r1 = returnFunc(ctx, subject, scopes, expiry) } else { r1 = ret.Error(1) } return r0, r1 } // MockAuthService_GenerateToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateToken' type MockAuthService_GenerateToken_Call struct { *mock.Call } // GenerateToken is a helper method to define mock.On call // - ctx context.Context // - subject string // - scopes []string // - expiry time.Duration func (_e *MockAuthService_Expecter) GenerateToken(ctx interface{}, subject interface{}, scopes interface{}, expiry interface{}) *MockAuthService_GenerateToken_Call { return &MockAuthService_GenerateToken_Call{Call: _e.mock.On("GenerateToken", ctx, subject, scopes, expiry)} } func (_c *MockAuthService_GenerateToken_Call) Run(run func(ctx context.Context, subject string, scopes []string, expiry time.Duration)) *MockAuthService_GenerateToken_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) } var arg2 []string if args[2] != nil { arg2 = args[2].([]string) } var arg3 time.Duration if args[3] != nil { arg3 = args[3].(time.Duration) } run( arg0, arg1, arg2, arg3, ) }) return _c } func (_c *MockAuthService_GenerateToken_Call) Return(s string, err error) *MockAuthService_GenerateToken_Call { _c.Call.Return(s, err) return _c } func (_c *MockAuthService_GenerateToken_Call) RunAndReturn(run func(ctx context.Context, subject string, scopes []string, expiry time.Duration) (string, error)) *MockAuthService_GenerateToken_Call { _c.Call.Return(run) return _c } // GetAuthStatus provides a mock function for the type MockAuthService func (_mock *MockAuthService) GetAuthStatus(ctx context.Context) (*domain.AuthStatus, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for GetAuthStatus") } var r0 *domain.AuthStatus var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) (*domain.AuthStatus, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) *domain.AuthStatus); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*domain.AuthStatus) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockAuthService_GetAuthStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuthStatus' type MockAuthService_GetAuthStatus_Call struct { *mock.Call } // GetAuthStatus is a helper method to define mock.On call // - ctx context.Context func (_e *MockAuthService_Expecter) GetAuthStatus(ctx interface{}) *MockAuthService_GetAuthStatus_Call { return &MockAuthService_GetAuthStatus_Call{Call: _e.mock.On("GetAuthStatus", ctx)} } func (_c *MockAuthService_GetAuthStatus_Call) Run(run func(ctx context.Context)) *MockAuthService_GetAuthStatus_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockAuthService_GetAuthStatus_Call) Return(authStatus *domain.AuthStatus, err error) *MockAuthService_GetAuthStatus_Call { _c.Call.Return(authStatus, err) return _c } func (_c *MockAuthService_GetAuthStatus_Call) RunAndReturn(run func(ctx context.Context) (*domain.AuthStatus, error)) *MockAuthService_GetAuthStatus_Call { _c.Call.Return(run) return _c } // GetAuthType provides a mock function for the type MockAuthService func (_mock *MockAuthService) GetAuthType() domain.AuthType { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for GetAuthType") } var r0 domain.AuthType if returnFunc, ok := ret.Get(0).(func() domain.AuthType); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(domain.AuthType) } return r0 } // MockAuthService_GetAuthType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuthType' type MockAuthService_GetAuthType_Call struct { *mock.Call } // GetAuthType is a helper method to define mock.On call func (_e *MockAuthService_Expecter) GetAuthType() *MockAuthService_GetAuthType_Call { return &MockAuthService_GetAuthType_Call{Call: _e.mock.On("GetAuthType")} } func (_c *MockAuthService_GetAuthType_Call) Run(run func()) *MockAuthService_GetAuthType_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockAuthService_GetAuthType_Call) Return(authType domain.AuthType) *MockAuthService_GetAuthType_Call { _c.Call.Return(authType) return _c } func (_c *MockAuthService_GetAuthType_Call) RunAndReturn(run func() domain.AuthType) *MockAuthService_GetAuthType_Call { _c.Call.Return(run) return _c } // IsEnabled provides a mock function for the type MockAuthService func (_mock *MockAuthService) IsEnabled() bool { ret := _mock.Called() if len(ret) == 0 { panic("no return value specified for IsEnabled") } var r0 bool if returnFunc, ok := ret.Get(0).(func() bool); ok { r0 = returnFunc() } else { r0 = ret.Get(0).(bool) } return r0 } // MockAuthService_IsEnabled_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsEnabled' type MockAuthService_IsEnabled_Call struct { *mock.Call } // IsEnabled is a helper method to define mock.On call func (_e *MockAuthService_Expecter) IsEnabled() *MockAuthService_IsEnabled_Call { return &MockAuthService_IsEnabled_Call{Call: _e.mock.On("IsEnabled")} } func (_c *MockAuthService_IsEnabled_Call) Run(run func()) *MockAuthService_IsEnabled_Call { _c.Call.Run(func(args mock.Arguments) { run() }) return _c } func (_c *MockAuthService_IsEnabled_Call) Return(b bool) *MockAuthService_IsEnabled_Call { _c.Call.Return(b) return _c } func (_c *MockAuthService_IsEnabled_Call) RunAndReturn(run func() bool) *MockAuthService_IsEnabled_Call { _c.Call.Return(run) return _c } // ListTokens provides a mock function for the type MockAuthService func (_mock *MockAuthService) ListTokens(ctx context.Context) ([]domain.Token, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for ListTokens") } var r0 []domain.Token var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) ([]domain.Token, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) []domain.Token); ok { r0 = returnFunc(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]domain.Token) } } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockAuthService_ListTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListTokens' type MockAuthService_ListTokens_Call struct { *mock.Call } // ListTokens is a helper method to define mock.On call // - ctx context.Context func (_e *MockAuthService_Expecter) ListTokens(ctx interface{}) *MockAuthService_ListTokens_Call { return &MockAuthService_ListTokens_Call{Call: _e.mock.On("ListTokens", ctx)} } func (_c *MockAuthService_ListTokens_Call) Run(run func(ctx context.Context)) *MockAuthService_ListTokens_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockAuthService_ListTokens_Call) Return(tokens []domain.Token, err error) *MockAuthService_ListTokens_Call { _c.Call.Return(tokens, err) return _c } func (_c *MockAuthService_ListTokens_Call) RunAndReturn(run func(ctx context.Context) ([]domain.Token, error)) *MockAuthService_ListTokens_Call { _c.Call.Return(run) return _c } // RevokeAllTokens provides a mock function for the type MockAuthService func (_mock *MockAuthService) RevokeAllTokens(ctx context.Context) (int, error) { ret := _mock.Called(ctx) if len(ret) == 0 { panic("no return value specified for RevokeAllTokens") } var r0 int var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context) (int, error)); ok { return returnFunc(ctx) } if returnFunc, ok := ret.Get(0).(func(context.Context) int); ok { r0 = returnFunc(ctx) } else { r0 = ret.Get(0).(int) } if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok { r1 = returnFunc(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockAuthService_RevokeAllTokens_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RevokeAllTokens' type MockAuthService_RevokeAllTokens_Call struct { *mock.Call } // RevokeAllTokens is a helper method to define mock.On call // - ctx context.Context func (_e *MockAuthService_Expecter) RevokeAllTokens(ctx interface{}) *MockAuthService_RevokeAllTokens_Call { return &MockAuthService_RevokeAllTokens_Call{Call: _e.mock.On("RevokeAllTokens", ctx)} } func (_c *MockAuthService_RevokeAllTokens_Call) Run(run func(ctx context.Context)) *MockAuthService_RevokeAllTokens_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { arg0 = args[0].(context.Context) } run( arg0, ) }) return _c } func (_c *MockAuthService_RevokeAllTokens_Call) Return(n int, err error) *MockAuthService_RevokeAllTokens_Call { _c.Call.Return(n, err) return _c } func (_c *MockAuthService_RevokeAllTokens_Call) RunAndReturn(run func(ctx context.Context) (int, error)) *MockAuthService_RevokeAllTokens_Call { _c.Call.Return(run) return _c } // RevokeToken provides a mock function for the type MockAuthService func (_mock *MockAuthService) RevokeToken(ctx context.Context, tokenID string) error { ret := _mock.Called(ctx, tokenID) if len(ret) == 0 { panic("no return value specified for RevokeToken") } var r0 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok { r0 = returnFunc(ctx, tokenID) } else { r0 = ret.Error(0) } return r0 } // MockAuthService_RevokeToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RevokeToken' type MockAuthService_RevokeToken_Call struct { *mock.Call } // RevokeToken is a helper method to define mock.On call // - ctx context.Context // - tokenID string func (_e *MockAuthService_Expecter) RevokeToken(ctx interface{}, tokenID interface{}) *MockAuthService_RevokeToken_Call { return &MockAuthService_RevokeToken_Call{Call: _e.mock.On("RevokeToken", ctx, tokenID)} } func (_c *MockAuthService_RevokeToken_Call) Run(run func(ctx context.Context, tokenID string)) *MockAuthService_RevokeToken_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 *MockAuthService_RevokeToken_Call) Return(err error) *MockAuthService_RevokeToken_Call { _c.Call.Return(err) return _c } func (_c *MockAuthService_RevokeToken_Call) RunAndReturn(run func(ctx context.Context, tokenID string) error) *MockAuthService_RevokeToken_Call { _c.Call.Return(run) return _c } // ValidatePassword provides a mock function for the type MockAuthService func (_mock *MockAuthService) ValidatePassword(ctx context.Context, username string, password string) bool { ret := _mock.Called(ctx, username, password) if len(ret) == 0 { panic("no return value specified for ValidatePassword") } var r0 bool if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) bool); ok { r0 = returnFunc(ctx, username, password) } else { r0 = ret.Get(0).(bool) } return r0 } // MockAuthService_ValidatePassword_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidatePassword' type MockAuthService_ValidatePassword_Call struct { *mock.Call } // ValidatePassword is a helper method to define mock.On call // - ctx context.Context // - username string // - password string func (_e *MockAuthService_Expecter) ValidatePassword(ctx interface{}, username interface{}, password interface{}) *MockAuthService_ValidatePassword_Call { return &MockAuthService_ValidatePassword_Call{Call: _e.mock.On("ValidatePassword", ctx, username, password)} } func (_c *MockAuthService_ValidatePassword_Call) Run(run func(ctx context.Context, username string, password string)) *MockAuthService_ValidatePassword_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) } var arg2 string if args[2] != nil { arg2 = args[2].(string) } run( arg0, arg1, arg2, ) }) return _c } func (_c *MockAuthService_ValidatePassword_Call) Return(b bool) *MockAuthService_ValidatePassword_Call { _c.Call.Return(b) return _c } func (_c *MockAuthService_ValidatePassword_Call) RunAndReturn(run func(ctx context.Context, username string, password string) bool) *MockAuthService_ValidatePassword_Call { _c.Call.Return(run) return _c } // ValidateToken provides a mock function for the type MockAuthService func (_mock *MockAuthService) ValidateToken(ctx context.Context, tokenString string) (*domain.TokenClaims, error) { ret := _mock.Called(ctx, tokenString) if len(ret) == 0 { panic("no return value specified for ValidateToken") } var r0 *domain.TokenClaims var r1 error if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*domain.TokenClaims, error)); ok { return returnFunc(ctx, tokenString) } if returnFunc, ok := ret.Get(0).(func(context.Context, string) *domain.TokenClaims); ok { r0 = returnFunc(ctx, tokenString) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*domain.TokenClaims) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = returnFunc(ctx, tokenString) } else { r1 = ret.Error(1) } return r0, r1 } // MockAuthService_ValidateToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateToken' type MockAuthService_ValidateToken_Call struct { *mock.Call } // ValidateToken is a helper method to define mock.On call // - ctx context.Context // - tokenString string func (_e *MockAuthService_Expecter) ValidateToken(ctx interface{}, tokenString interface{}) *MockAuthService_ValidateToken_Call { return &MockAuthService_ValidateToken_Call{Call: _e.mock.On("ValidateToken", ctx, tokenString)} } func (_c *MockAuthService_ValidateToken_Call) Run(run func(ctx context.Context, tokenString string)) *MockAuthService_ValidateToken_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 *MockAuthService_ValidateToken_Call) Return(tokenClaims *domain.TokenClaims, err error) *MockAuthService_ValidateToken_Call { _c.Call.Return(tokenClaims, err) return _c } func (_c *MockAuthService_ValidateToken_Call) RunAndReturn(run func(ctx context.Context, tokenString string) (*domain.TokenClaims, error)) *MockAuthService_ValidateToken_Call { _c.Call.Return(run) return _c }