Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SecretProviderMock ¶
type SecretProviderMock struct { // GetFunc mocks the Get method. GetFunc func(key string) (string, error) // SetFunc mocks the Set method. SetFunc func(key string, value string) (string, error) // contains filtered or unexported fields }
SecretProviderMock is a mock implementation of secrets.SecretProvider.
func TestSomethingThatUsesSecretProvider(t *testing.T) { // make and configure a mocked secrets.SecretProvider mockedSecretProvider := &SecretProviderMock{ GetFunc: func(key string) (string, error) { panic("mock out the Get method") }, SetFunc: func(key string, value string) (string, error) { panic("mock out the Set method") }, } // use mockedSecretProvider in code that requires secrets.SecretProvider // and then make assertions. }
func (*SecretProviderMock) Get ¶
func (mock *SecretProviderMock) Get(key string) (string, error)
Get calls GetFunc.
func (*SecretProviderMock) GetCalls ¶
func (mock *SecretProviderMock) GetCalls() []struct { Key string }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedSecretProvider.GetCalls())
func (*SecretProviderMock) Set ¶
func (mock *SecretProviderMock) Set(key string, value string) (string, error)
Set calls SetFunc.
func (*SecretProviderMock) SetCalls ¶
func (mock *SecretProviderMock) SetCalls() []struct { Key string Value string }
SetCalls gets all the calls that were made to Set. Check the length with:
len(mockedSecretProvider.SetCalls())
Click to show internal directories.
Click to hide internal directories.