mocks

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package mocks contains mocks for testing purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmailer

func NewEmailer() users.Emailer

NewEmailer provides emailer instance for the test.

func NewHasher

func NewHasher() users.Hasher

NewHasher creates "no-op" hasher for test purposes. This implementation will return secrets without changing them.

Types

type Repository

type Repository struct {
	mock.Mock
}

Repository is an autogenerated mock type for the Repository type

func NewRepository

func NewRepository(t interface {
	mock.TestingT
	Cleanup(func())
}) *Repository

NewRepository creates a new instance of Repository. 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 (*Repository) ChangeStatus

func (_m *Repository) ChangeStatus(ctx context.Context, client clients.Client) (clients.Client, error)

ChangeStatus provides a mock function with given fields: ctx, client

func (*Repository) CheckSuperAdmin

func (_m *Repository) CheckSuperAdmin(ctx context.Context, adminID string) error

CheckSuperAdmin provides a mock function with given fields: ctx, adminID

func (*Repository) RetrieveAll

func (_m *Repository) RetrieveAll(ctx context.Context, pm clients.Page) (clients.ClientsPage, error)

RetrieveAll provides a mock function with given fields: ctx, pm

func (*Repository) RetrieveAllBasicInfo

func (_m *Repository) RetrieveAllBasicInfo(ctx context.Context, pm clients.Page) (clients.ClientsPage, error)

RetrieveAllBasicInfo provides a mock function with given fields: ctx, pm

func (*Repository) RetrieveAllByIDs

func (_m *Repository) RetrieveAllByIDs(ctx context.Context, pm clients.Page) (clients.ClientsPage, error)

RetrieveAllByIDs provides a mock function with given fields: ctx, pm

func (*Repository) RetrieveByID

func (_m *Repository) RetrieveByID(ctx context.Context, id string) (clients.Client, error)

RetrieveByID provides a mock function with given fields: ctx, id

func (*Repository) RetrieveByIdentity

func (_m *Repository) RetrieveByIdentity(ctx context.Context, identity string) (clients.Client, error)

RetrieveByIdentity provides a mock function with given fields: ctx, identity

func (*Repository) Save

func (_m *Repository) Save(ctx context.Context, client clients.Client) (clients.Client, error)

Save provides a mock function with given fields: ctx, client

func (*Repository) Update

func (_m *Repository) Update(ctx context.Context, client clients.Client) (clients.Client, error)

Update provides a mock function with given fields: ctx, client

func (*Repository) UpdateIdentity

func (_m *Repository) UpdateIdentity(ctx context.Context, client clients.Client) (clients.Client, error)

UpdateIdentity provides a mock function with given fields: ctx, client

func (*Repository) UpdateRole

func (_m *Repository) UpdateRole(ctx context.Context, client clients.Client) (clients.Client, error)

UpdateRole provides a mock function with given fields: ctx, client

func (*Repository) UpdateSecret

func (_m *Repository) UpdateSecret(ctx context.Context, client clients.Client) (clients.Client, error)

UpdateSecret provides a mock function with given fields: ctx, client

func (*Repository) UpdateTags

func (_m *Repository) UpdateTags(ctx context.Context, client clients.Client) (clients.Client, error)

UpdateTags provides a mock function with given fields: ctx, client

type Service

type Service struct {
	mock.Mock
}

Service is an autogenerated mock type for the Service type

func NewService

func NewService(t interface {
	mock.TestingT
	Cleanup(func())
}) *Service

NewService creates a new instance of Service. 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 (*Service) DisableClient

func (_m *Service) DisableClient(ctx context.Context, token string, id string) (clients.Client, error)

DisableClient provides a mock function with given fields: ctx, token, id

func (*Service) EnableClient

func (_m *Service) EnableClient(ctx context.Context, token string, id string) (clients.Client, error)

EnableClient provides a mock function with given fields: ctx, token, id

func (*Service) GenerateResetToken

func (_m *Service) GenerateResetToken(ctx context.Context, email string, host string) error

GenerateResetToken provides a mock function with given fields: ctx, email, host

func (*Service) Identify

func (_m *Service) Identify(ctx context.Context, tkn string) (string, error)

Identify provides a mock function with given fields: ctx, tkn

func (*Service) IssueToken

func (_m *Service) IssueToken(ctx context.Context, identity string, secret string, domainID string) (*magistrala.Token, error)

IssueToken provides a mock function with given fields: ctx, identity, secret, domainID

func (*Service) ListClients

func (_m *Service) ListClients(ctx context.Context, token string, pm clients.Page) (clients.ClientsPage, error)

ListClients provides a mock function with given fields: ctx, token, pm

func (*Service) ListMembers

func (_m *Service) ListMembers(ctx context.Context, token string, objectKind string, objectID string, pm clients.Page) (clients.MembersPage, error)

ListMembers provides a mock function with given fields: ctx, token, objectKind, objectID, pm

func (*Service) RefreshToken

func (_m *Service) RefreshToken(ctx context.Context, accessToken string, domainID string) (*magistrala.Token, error)

RefreshToken provides a mock function with given fields: ctx, accessToken, domainID

func (*Service) RegisterClient

func (_m *Service) RegisterClient(ctx context.Context, token string, client clients.Client) (clients.Client, error)

RegisterClient provides a mock function with given fields: ctx, token, client

func (*Service) ResetSecret

func (_m *Service) ResetSecret(ctx context.Context, resetToken string, secret string) error

ResetSecret provides a mock function with given fields: ctx, resetToken, secret

func (*Service) SendPasswordReset

func (_m *Service) SendPasswordReset(ctx context.Context, host string, email string, user string, token string) error

SendPasswordReset provides a mock function with given fields: ctx, host, email, user, token

func (*Service) UpdateClient

func (_m *Service) UpdateClient(ctx context.Context, token string, client clients.Client) (clients.Client, error)

UpdateClient provides a mock function with given fields: ctx, token, client

func (*Service) UpdateClientIdentity

func (_m *Service) UpdateClientIdentity(ctx context.Context, token string, id string, identity string) (clients.Client, error)

UpdateClientIdentity provides a mock function with given fields: ctx, token, id, identity

func (*Service) UpdateClientRole

func (_m *Service) UpdateClientRole(ctx context.Context, token string, client clients.Client) (clients.Client, error)

UpdateClientRole provides a mock function with given fields: ctx, token, client

func (*Service) UpdateClientSecret

func (_m *Service) UpdateClientSecret(ctx context.Context, token string, oldSecret string, newSecret string) (clients.Client, error)

UpdateClientSecret provides a mock function with given fields: ctx, token, oldSecret, newSecret

func (*Service) UpdateClientTags

func (_m *Service) UpdateClientTags(ctx context.Context, token string, client clients.Client) (clients.Client, error)

UpdateClientTags provides a mock function with given fields: ctx, token, client

func (*Service) ViewClient

func (_m *Service) ViewClient(ctx context.Context, token string, id string) (clients.Client, error)

ViewClient provides a mock function with given fields: ctx, token, id

func (*Service) ViewProfile

func (_m *Service) ViewProfile(ctx context.Context, token string) (clients.Client, error)

ViewProfile provides a mock function with given fields: ctx, token

Jump to

Keyboard shortcuts

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