tests

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAccountModel

func BuildAccountModel(id, userID, providerID, accountID string) *models.Account

func NewImpersonationServiceFixture

impersonation service fixture returns service and all repos + helpers

func NewStateServiceFixture

helper for constructing service directly with mocks

func PtrString

func PtrString(t *testing.T, s string) *string

func PtrTime

func PtrTime(t *testing.T, offset int) *time.Time

Types

type MockImpersonationRepository

type MockImpersonationRepository struct {
	mock.Mock
}

func (*MockImpersonationRepository) CreateImpersonation

func (m *MockImpersonationRepository) CreateImpersonation(ctx context.Context, impersonation *types.Impersonation) error

func (*MockImpersonationRepository) EndImpersonation

func (m *MockImpersonationRepository) EndImpersonation(ctx context.Context, impersonationID string, endedByUserID *string) error

func (*MockImpersonationRepository) GetActiveImpersonationByID

func (m *MockImpersonationRepository) GetActiveImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)

func (*MockImpersonationRepository) GetAllImpersonations

func (m *MockImpersonationRepository) GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)

func (*MockImpersonationRepository) GetImpersonationByID

func (m *MockImpersonationRepository) GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)

func (*MockImpersonationRepository) GetLatestActiveImpersonationByActor

func (m *MockImpersonationRepository) GetLatestActiveImpersonationByActor(ctx context.Context, actorUserID string) (*types.Impersonation, error)

func (*MockImpersonationRepository) UserExists

func (m *MockImpersonationRepository) UserExists(ctx context.Context, userID string) (bool, error)

type MockPasswordService

type MockPasswordService struct {
	mock.Mock
}

func (*MockPasswordService) Hash

func (m *MockPasswordService) Hash(password string) (string, error)

func (*MockPasswordService) Verify

func (m *MockPasswordService) Verify(password, encoded string) bool

type MockSessionStateRepository

type MockSessionStateRepository struct {
	mock.Mock
}

func (*MockSessionStateRepository) Create

func (*MockSessionStateRepository) Delete

func (m *MockSessionStateRepository) Delete(ctx context.Context, sessionID string) error

func (*MockSessionStateRepository) GetBySessionID

func (m *MockSessionStateRepository) GetBySessionID(ctx context.Context, sessionID string) (*types.AdminSessionState, error)

func (*MockSessionStateRepository) GetByUserID

func (m *MockSessionStateRepository) GetByUserID(ctx context.Context, userID string) ([]types.AdminUserSession, error)

func (*MockSessionStateRepository) GetRevoked

func (*MockSessionStateRepository) SessionExists

func (m *MockSessionStateRepository) SessionExists(ctx context.Context, sessionID string) (bool, error)

func (*MockSessionStateRepository) Update

func (*MockSessionStateRepository) Upsert

type MockUserStateRepository

type MockUserStateRepository struct {
	mock.Mock
}

func (*MockUserStateRepository) Create

func (*MockUserStateRepository) Delete

func (m *MockUserStateRepository) Delete(ctx context.Context, userID string) error

func (*MockUserStateRepository) GetBanned

func (*MockUserStateRepository) GetByUserID

func (m *MockUserStateRepository) GetByUserID(ctx context.Context, userID string) (*types.AdminUserState, error)

func (*MockUserStateRepository) Update

func (*MockUserStateRepository) Upsert

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL