mocks

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretProvider

type SecretProvider struct {
	// GetFunc mocks the Get method.
	GetFunc func(key string) (string, error)
	// contains filtered or unexported fields
}

SecretProvider is a mock implementation of config.secretsProvider.

func TestSomethingThatUsessecretsProvider(t *testing.T) {

	// make and configure a mocked config.secretsProvider
	mockedsecretsProvider := &SecretProvider{
		GetFunc: func(key string) (string, error) {
			panic("mock out the Get method")
		},
	}

	// use mockedsecretsProvider in code that requires config.secretsProvider
	// and then make assertions.

}

func (*SecretProvider) Get

func (mock *SecretProvider) Get(key string) (string, error)

Get calls GetFunc.

func (*SecretProvider) GetCalls

func (mock *SecretProvider) GetCalls() []struct {
	Key string
}

GetCalls gets all the calls that were made to Get. Check the length with:

len(mockedsecretsProvider.GetCalls())

Jump to

Keyboard shortcuts

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