tests

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupApiKey

func SetupApiKey(t *testing.T, sqlStore *sqlstore.SQLStore, testKey TestApiKey) *apikey.APIKey

func SetupUserServiceAccount

func SetupUserServiceAccount(t *testing.T, sqlStore *sqlstore.SQLStore, testUser TestUser) *user.User

Types

type MockServiceAccountService

type MockServiceAccountService struct {
	mock.Mock
}

func (*MockServiceAccountService) AddServiceAccountToken

func (s *MockServiceAccountService) AddServiceAccountToken(ctx context.Context, serviceAccountID int64, cmd *serviceaccounts.AddServiceAccountTokenCommand) (*apikey.APIKey, error)

AddServiceAccountToken implements serviceaccounts.Service

func (*MockServiceAccountService) CreateServiceAccount

CreateServiceAccount implements serviceaccounts.Service

func (*MockServiceAccountService) DeleteServiceAccount

func (s *MockServiceAccountService) DeleteServiceAccount(ctx context.Context, orgID int64, serviceAccountID int64) error

DeleteServiceAccount implements serviceaccounts.Service

func (*MockServiceAccountService) RetrieveServiceAccount

func (s *MockServiceAccountService) RetrieveServiceAccount(ctx context.Context, orgID int64, serviceAccountID int64) (*serviceaccounts.ServiceAccountProfileDTO, error)

RetrieveServiceAccount implements serviceaccounts.Service

func (*MockServiceAccountService) RetrieveServiceAccountIdByName

func (s *MockServiceAccountService) RetrieveServiceAccountIdByName(ctx context.Context, orgID int64, name string) (int64, error)

RetrieveServiceAccountIdByName implements serviceaccounts.Service

func (*MockServiceAccountService) UpdateServiceAccount

UpdateServiceAccount implements serviceaccounts.Service

type TestApiKey

type TestApiKey struct {
	Name             string
	Role             org.RoleType
	OrgId            int64
	Key              string
	IsExpired        bool
	ServiceAccountID *int64
}

type TestUser

type TestUser struct {
	Name             string
	Role             string
	Login            string
	IsServiceAccount bool
}

Jump to

Keyboard shortcuts

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