mocks

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package mocks provides a mock implementation of the IEncryptorBuilder interface for testing purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IEncrypter

type IEncrypter struct {
	mock.Mock
}

IEncrypter is an autogenerated mock type for the IEncrypter type

func NewIEncrypter

func NewIEncrypter(t interface {
	mock.TestingT
	Cleanup(func())
}) *IEncrypter

NewIEncrypter creates a new instance of IEncrypter. 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 (*IEncrypter) Decrypt

func (_m *IEncrypter) Decrypt(cipherText []byte) ([]byte, error)

Decrypt provides a mock function with given fields: cipherText

func (*IEncrypter) EXPECT

func (_m *IEncrypter) EXPECT() *IEncrypter_Expecter

func (*IEncrypter) Encrypt

func (_m *IEncrypter) Encrypt(plainText []byte) ([]byte, error)

Encrypt provides a mock function with given fields: plainText

func (*IEncrypter) GetEncryptedDataKey

func (_m *IEncrypter) GetEncryptedDataKey() []byte

GetEncryptedDataKey provides a mock function with no fields

type IEncrypter_Decrypt_Call

type IEncrypter_Decrypt_Call struct {
	*mock.Call
}

IEncrypter_Decrypt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Decrypt'

func (*IEncrypter_Decrypt_Call) Return

func (_c *IEncrypter_Decrypt_Call) Return(plainText []byte, err error) *IEncrypter_Decrypt_Call

func (*IEncrypter_Decrypt_Call) Run

func (_c *IEncrypter_Decrypt_Call) Run(run func(cipherText []byte)) *IEncrypter_Decrypt_Call

func (*IEncrypter_Decrypt_Call) RunAndReturn

func (_c *IEncrypter_Decrypt_Call) RunAndReturn(run func([]byte) ([]byte, error)) *IEncrypter_Decrypt_Call

type IEncrypter_Encrypt_Call

type IEncrypter_Encrypt_Call struct {
	*mock.Call
}

IEncrypter_Encrypt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Encrypt'

func (*IEncrypter_Encrypt_Call) Return

func (_c *IEncrypter_Encrypt_Call) Return(cipherText []byte, err error) *IEncrypter_Encrypt_Call

func (*IEncrypter_Encrypt_Call) Run

func (_c *IEncrypter_Encrypt_Call) Run(run func(plainText []byte)) *IEncrypter_Encrypt_Call

func (*IEncrypter_Encrypt_Call) RunAndReturn

func (_c *IEncrypter_Encrypt_Call) RunAndReturn(run func([]byte) ([]byte, error)) *IEncrypter_Encrypt_Call

type IEncrypter_Expecter

type IEncrypter_Expecter struct {
	// contains filtered or unexported fields
}

func (*IEncrypter_Expecter) Decrypt

func (_e *IEncrypter_Expecter) Decrypt(cipherText interface{}) *IEncrypter_Decrypt_Call

Decrypt is a helper method to define mock.On call

  • cipherText []byte

func (*IEncrypter_Expecter) Encrypt

func (_e *IEncrypter_Expecter) Encrypt(plainText interface{}) *IEncrypter_Encrypt_Call

Encrypt is a helper method to define mock.On call

  • plainText []byte

func (*IEncrypter_Expecter) GetEncryptedDataKey

func (_e *IEncrypter_Expecter) GetEncryptedDataKey() *IEncrypter_GetEncryptedDataKey_Call

GetEncryptedDataKey is a helper method to define mock.On call

type IEncrypter_GetEncryptedDataKey_Call

type IEncrypter_GetEncryptedDataKey_Call struct {
	*mock.Call
}

IEncrypter_GetEncryptedDataKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEncryptedDataKey'

func (*IEncrypter_GetEncryptedDataKey_Call) Return

func (*IEncrypter_GetEncryptedDataKey_Call) Run

func (*IEncrypter_GetEncryptedDataKey_Call) RunAndReturn

type MockEncryptorBuilder

type MockEncryptorBuilder struct {
	// contains filtered or unexported fields
}

MockEncryptorBuilder is a mock implementation of the IEncryptorBuilder interface.

func NewMockEncryptorBuilder

func NewMockEncryptorBuilder(encrypter encryption.IEncrypter) *MockEncryptorBuilder

NewMockEncryptorBuilder creates a new instance of MockEncryptorBuilder with the provided encrypter.

func (*MockEncryptorBuilder) Build

Build creates a new encryption.IEncrypter instance.

Jump to

Keyboard shortcuts

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