Versions in this module Expand all Collapse all v1 v1.0.0 Mar 21, 2026 Changes in this version + func AssertErrorMessage(t *testing.T, reqCtx *models.RequestContext, status int, message string) + func AssertHasKey(t *testing.T, envelope map[string]any, key string) + func ConcreteRoutePath(path string) string + func DecodeJSONResponse(t *testing.T, w *httptest.ResponseRecorder) map[string]any + func DecodeResponseJSON[T any](t *testing.T, reqCtx *models.RequestContext) T + func GetArray(t *testing.T, envelope map[string]any, key string) []any + func GetMap(t *testing.T, envelope map[string]any, key string) map[string]any + func GetString(t *testing.T, envelope map[string]any, key string) string + func JSONRequest(t *testing.T, handler http.Handler, method, path string, payload any) *httptest.ResponseRecorder + func MarshalToJSON(t *testing.T, payload any) []byte + func NewHandlerRequest(t *testing.T, method string, path string, body []byte, userID *string) (*http.Request, *httptest.ResponseRecorder, *models.RequestContext) + func NewIntegrationTestDBFromEnv(t *testing.T) (*bun.DB, string) + func NewMySQLIntegrationDB(t *testing.T) *bun.DB + func NewPostgresIntegrationDB(t *testing.T) *bun.DB + func NewSQLiteIntegrationDB(t *testing.T) *bun.DB + func PtrString(s string) *string + func PtrTime(t time.Time) *time.Time + func Request(t *testing.T, handler http.Handler, method, path string, body *bytes.Buffer) *httptest.ResponseRecorder + type BaseTestFixture struct + AccountService coreservices.AccountService + Config *models.Config + DB *bun.DB + Provider string + ServiceRegistry models.ServiceRegistry + SessionService coreservices.SessionService + T *testing.T + TokenService coreservices.TokenService + UserService coreservices.UserService + VerificationService coreservices.VerificationService + func NewBaseTestFixture(t *testing.T, options ...config.ConfigOption) *BaseTestFixture + func (f *BaseTestFixture) ResolveID(id string) string + func (f *BaseTestFixture) SeedSession(sessionID, userID string) string + func (f *BaseTestFixture) SeedUser(id, email string) string + type MockAccountRepository struct + func (m *MockAccountRepository) Create(ctx context.Context, account *models.Account) (*models.Account, error) + func (m *MockAccountRepository) Delete(ctx context.Context, id string) error + func (m *MockAccountRepository) GetAllByUserID(ctx context.Context, userID string) ([]models.Account, error) + func (m *MockAccountRepository) GetByID(ctx context.Context, id string) (*models.Account, error) + func (m *MockAccountRepository) GetByProviderAndAccountID(ctx context.Context, provider string, accountID string) (*models.Account, error) + func (m *MockAccountRepository) GetByUserID(ctx context.Context, userID string) (*models.Account, error) + func (m *MockAccountRepository) GetByUserIDAndProvider(ctx context.Context, userID string, provider string) (*models.Account, error) + func (m *MockAccountRepository) Update(ctx context.Context, account *models.Account) (*models.Account, error) + func (m *MockAccountRepository) UpdateFields(ctx context.Context, userID string, fields map[string]any) error + func (m *MockAccountRepository) WithTx(tx bun.IDB) repositories.AccountRepository + type MockAccountService struct + func (m *MockAccountService) Create(ctx context.Context, userID, accountID, providerID string, password *string) (*models.Account, error) + func (m *MockAccountService) CreateOAuth2(ctx context.Context, userID, providerAccountID, provider, accessToken string, ...) (*models.Account, error) + func (m *MockAccountService) GetByProviderAndAccountID(ctx context.Context, provider, accountID string) (*models.Account, error) + func (m *MockAccountService) GetByUserID(ctx context.Context, userID string) (*models.Account, error) + func (m *MockAccountService) GetByUserIDAndProvider(ctx context.Context, userID, provider string) (*models.Account, error) + func (m *MockAccountService) Update(ctx context.Context, account *models.Account) (*models.Account, error) + func (m *MockAccountService) UpdateFields(ctx context.Context, userID string, fields map[string]any) error + type MockEventBus struct + func (m *MockEventBus) Close() error + func (m *MockEventBus) Publish(ctx context.Context, event models.Event) error + func (m *MockEventBus) Subscribe(topic string, handler models.EventHandler) (models.SubscriptionID, error) + func (m *MockEventBus) Unsubscribe(topic string, subscriptionID models.SubscriptionID) + type MockLogger struct + func (m *MockLogger) Debug(msg string, args ...any) + func (m *MockLogger) Error(msg string, args ...any) + func (m *MockLogger) Info(msg string, args ...any) + func (m *MockLogger) Panic(msg string, args ...any) + func (m *MockLogger) Warn(msg string, args ...any) + func (m *MockLogger) WithField(key string, value any) models.Logger + func (m *MockLogger) WithFields(fields map[string]any) models.Logger + type MockMailerService struct + func (m *MockMailerService) SendEmail(ctx context.Context, to string, subject string, text string, html string) error + type MockPasswordService struct + func (m *MockPasswordService) Hash(password string) (string, error) + func (m *MockPasswordService) Verify(password, encoded string) bool + type MockServiceRegistry struct + func (m *MockServiceRegistry) Get(name string) any + func (m *MockServiceRegistry) Register(name string, service any) + type MockSessionRepository struct + func (m *MockSessionRepository) Create(ctx context.Context, session *models.Session) (*models.Session, error) + func (m *MockSessionRepository) Delete(ctx context.Context, id string) error + func (m *MockSessionRepository) DeleteByUserID(ctx context.Context, userID string) error + func (m *MockSessionRepository) DeleteExpired(ctx context.Context) error + func (m *MockSessionRepository) DeleteOldestByUserID(ctx context.Context, userID string, maxCount int) error + func (m *MockSessionRepository) GetByID(ctx context.Context, id string) (*models.Session, error) + func (m *MockSessionRepository) GetByToken(ctx context.Context, token string) (*models.Session, error) + func (m *MockSessionRepository) GetByUserID(ctx context.Context, userID string) (*models.Session, error) + func (m *MockSessionRepository) GetDistinctUserIDs(ctx context.Context) ([]string, error) + func (m *MockSessionRepository) Update(ctx context.Context, session *models.Session) (*models.Session, error) + func (m *MockSessionRepository) WithTx(tx bun.IDB) *MockSessionRepository + type MockSessionService struct + func (m *MockSessionService) Create(ctx context.Context, userID, hashedToken string, ipAddress, userAgent *string, ...) (*models.Session, error) + func (m *MockSessionService) Delete(ctx context.Context, id string) error + func (m *MockSessionService) DeleteAllByUserID(ctx context.Context, userID string) error + func (m *MockSessionService) DeleteAllExpired(ctx context.Context) error + func (m *MockSessionService) DeleteOldestByUserID(ctx context.Context, userID string, maxCount int) error + func (m *MockSessionService) GetByID(ctx context.Context, id string) (*models.Session, error) + func (m *MockSessionService) GetByToken(ctx context.Context, hashedToken string) (*models.Session, error) + func (m *MockSessionService) GetByUserID(ctx context.Context, userID string) (*models.Session, error) + func (m *MockSessionService) GetDistinctUserIDs(ctx context.Context) ([]string, error) + func (m *MockSessionService) Update(ctx context.Context, session *models.Session) (*models.Session, error) + type MockTokenRepository struct + func (m *MockTokenRepository) Decrypt(encrypted string) (string, error) + func (m *MockTokenRepository) Encrypt(token string) (string, error) + func (m *MockTokenRepository) Generate() (string, error) + func (m *MockTokenRepository) Hash(token string) string + type MockTokenService struct + func (m *MockTokenService) Decrypt(encrypted string) (string, error) + func (m *MockTokenService) Encrypt(token string) (string, error) + func (m *MockTokenService) Generate() (string, error) + func (m *MockTokenService) Hash(token string) string + type MockUserRepository struct + func (m *MockUserRepository) Create(ctx context.Context, user *models.User) (*models.User, error) + func (m *MockUserRepository) Delete(ctx context.Context, id string) error + func (m *MockUserRepository) GetAll(ctx context.Context, cursor *string, limit int) ([]models.User, *string, error) + func (m *MockUserRepository) GetByEmail(ctx context.Context, email string) (*models.User, error) + func (m *MockUserRepository) GetByID(ctx context.Context, id string) (*models.User, error) + func (m *MockUserRepository) Update(ctx context.Context, user *models.User) (*models.User, error) + func (m *MockUserRepository) UpdateFields(ctx context.Context, id string, fields map[string]any) error + func (m *MockUserRepository) WithTx(tx bun.IDB) repositories.UserRepository + type MockUserService struct + func (m *MockUserService) Create(ctx context.Context, name string, email string, emailVerified bool, ...) (*models.User, error) + func (m *MockUserService) Delete(ctx context.Context, id string) error + func (m *MockUserService) GetAll(ctx context.Context, cursor *string, limit int) ([]models.User, *string, error) + func (m *MockUserService) GetByEmail(ctx context.Context, email string) (*models.User, error) + func (m *MockUserService) GetByID(ctx context.Context, id string) (*models.User, error) + func (m *MockUserService) Update(ctx context.Context, user *models.User) (*models.User, error) + func (m *MockUserService) UpdateFields(ctx context.Context, id string, fields map[string]any) error + type MockVerificationRepository struct + func (m *MockVerificationRepository) Create(ctx context.Context, verification *models.Verification) (*models.Verification, error) + func (m *MockVerificationRepository) Delete(ctx context.Context, id string) error + func (m *MockVerificationRepository) DeleteByUserIDAndType(ctx context.Context, userID string, vType models.VerificationType) error + func (m *MockVerificationRepository) DeleteExpired(ctx context.Context) error + func (m *MockVerificationRepository) GetByID(ctx context.Context, id string) (*models.Verification, error) + func (m *MockVerificationRepository) GetByToken(ctx context.Context, token string) (*models.Verification, error) + func (m *MockVerificationRepository) WithTx(tx bun.IDB) *MockVerificationRepository + type MockVerificationService struct + func (m *MockVerificationService) Create(ctx context.Context, userID string, hashedToken string, ...) (*models.Verification, error) + func (m *MockVerificationService) Delete(ctx context.Context, id string) error + func (m *MockVerificationService) DeleteByUserIDAndType(ctx context.Context, userID string, vType models.VerificationType) error + func (m *MockVerificationService) DeleteExpired(ctx context.Context) error + func (m *MockVerificationService) GetByToken(ctx context.Context, hashedToken string) (*models.Verification, error) + func (m *MockVerificationService) IsExpired(verif *models.Verification) bool