credentialmanager_mock

package
v0.0.0-...-318a3d5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CredentialManagerInterfaceMock

type CredentialManagerInterfaceMock struct {
	// GetCredsFunc mocks the GetCreds method.
	GetCredsFunc func(namespace string) (url.URL, string, error)

	// GetCurrentKeptnCLIConfigFunc mocks the GetCurrentKeptnCLIConfig method.
	GetCurrentKeptnCLIConfigFunc func() config.CLIConfig

	// GetCurrentKubeConfigFunc mocks the GetCurrentKubeConfig method.
	GetCurrentKubeConfigFunc func() credentialmanager.KubeConfigFileType

	// GetInstallCredsFunc mocks the GetInstallCreds method.
	GetInstallCredsFunc func() (string, error)

	// SetCredsFunc mocks the SetCreds method.
	SetCredsFunc func(endPoint url.URL, apiToken string, namespace string) error

	// SetCurrentKeptnCLIConfigFunc mocks the SetCurrentKeptnCLIConfig method.
	SetCurrentKeptnCLIConfigFunc func(cliConfig config.CLIConfig)

	// SetCurrentKubeConfigFunc mocks the SetCurrentKubeConfig method.
	SetCurrentKubeConfigFunc func(kubeConfig credentialmanager.KubeConfigFileType)

	// SetInstallCredsFunc mocks the SetInstallCreds method.
	SetInstallCredsFunc func(creds string) error
	// contains filtered or unexported fields
}

CredentialManagerInterfaceMock is a mock implementation of credentialmanager.CredentialManagerInterface.

func TestSomethingThatUsesCredentialManagerInterface(t *testing.T) {

	// make and configure a mocked credentialmanager.CredentialManagerInterface
	mockedCredentialManagerInterface := &CredentialManagerInterfaceMock{
		GetCredsFunc: func(namespace string) (url.URL, string, error) {
			panic("mock out the GetCreds method")
		},
		GetCurrentKeptnCLIConfigFunc: func() config.CLIConfig {
			panic("mock out the GetCurrentKeptnCLIConfig method")
		},
		GetCurrentKubeConfigFunc: func() credentialmanager.KubeConfigFileType {
			panic("mock out the GetCurrentKubeConfig method")
		},
		GetInstallCredsFunc: func() (string, error) {
			panic("mock out the GetInstallCreds method")
		},
		SetCredsFunc: func(endPoint url.URL, apiToken string, namespace string) error {
			panic("mock out the SetCreds method")
		},
		SetCurrentKeptnCLIConfigFunc: func(cliConfig config.CLIConfig)  {
			panic("mock out the SetCurrentKeptnCLIConfig method")
		},
		SetCurrentKubeConfigFunc: func(kubeConfig credentialmanager.KubeConfigFileType)  {
			panic("mock out the SetCurrentKubeConfig method")
		},
		SetInstallCredsFunc: func(creds string) error {
			panic("mock out the SetInstallCreds method")
		},
	}

	// use mockedCredentialManagerInterface in code that requires credentialmanager.CredentialManagerInterface
	// and then make assertions.

}

func (*CredentialManagerInterfaceMock) GetCreds

func (mock *CredentialManagerInterfaceMock) GetCreds(namespace string) (url.URL, string, error)

GetCreds calls GetCredsFunc.

func (*CredentialManagerInterfaceMock) GetCredsCalls

func (mock *CredentialManagerInterfaceMock) GetCredsCalls() []struct {
	Namespace string
}

GetCredsCalls gets all the calls that were made to GetCreds. Check the length with:

len(mockedCredentialManagerInterface.GetCredsCalls())

func (*CredentialManagerInterfaceMock) GetCurrentKeptnCLIConfig

func (mock *CredentialManagerInterfaceMock) GetCurrentKeptnCLIConfig() config.CLIConfig

GetCurrentKeptnCLIConfig calls GetCurrentKeptnCLIConfigFunc.

func (*CredentialManagerInterfaceMock) GetCurrentKeptnCLIConfigCalls

func (mock *CredentialManagerInterfaceMock) GetCurrentKeptnCLIConfigCalls() []struct {
}

GetCurrentKeptnCLIConfigCalls gets all the calls that were made to GetCurrentKeptnCLIConfig. Check the length with:

len(mockedCredentialManagerInterface.GetCurrentKeptnCLIConfigCalls())

func (*CredentialManagerInterfaceMock) GetCurrentKubeConfig

GetCurrentKubeConfig calls GetCurrentKubeConfigFunc.

func (*CredentialManagerInterfaceMock) GetCurrentKubeConfigCalls

func (mock *CredentialManagerInterfaceMock) GetCurrentKubeConfigCalls() []struct {
}

GetCurrentKubeConfigCalls gets all the calls that were made to GetCurrentKubeConfig. Check the length with:

len(mockedCredentialManagerInterface.GetCurrentKubeConfigCalls())

func (*CredentialManagerInterfaceMock) GetInstallCreds

func (mock *CredentialManagerInterfaceMock) GetInstallCreds() (string, error)

GetInstallCreds calls GetInstallCredsFunc.

func (*CredentialManagerInterfaceMock) GetInstallCredsCalls

func (mock *CredentialManagerInterfaceMock) GetInstallCredsCalls() []struct {
}

GetInstallCredsCalls gets all the calls that were made to GetInstallCreds. Check the length with:

len(mockedCredentialManagerInterface.GetInstallCredsCalls())

func (*CredentialManagerInterfaceMock) SetCreds

func (mock *CredentialManagerInterfaceMock) SetCreds(endPoint url.URL, apiToken string, namespace string) error

SetCreds calls SetCredsFunc.

func (*CredentialManagerInterfaceMock) SetCredsCalls

func (mock *CredentialManagerInterfaceMock) SetCredsCalls() []struct {
	EndPoint  url.URL
	ApiToken  string
	Namespace string
}

SetCredsCalls gets all the calls that were made to SetCreds. Check the length with:

len(mockedCredentialManagerInterface.SetCredsCalls())

func (*CredentialManagerInterfaceMock) SetCurrentKeptnCLIConfig

func (mock *CredentialManagerInterfaceMock) SetCurrentKeptnCLIConfig(cliConfig config.CLIConfig)

SetCurrentKeptnCLIConfig calls SetCurrentKeptnCLIConfigFunc.

func (*CredentialManagerInterfaceMock) SetCurrentKeptnCLIConfigCalls

func (mock *CredentialManagerInterfaceMock) SetCurrentKeptnCLIConfigCalls() []struct {
	CliConfig config.CLIConfig
}

SetCurrentKeptnCLIConfigCalls gets all the calls that were made to SetCurrentKeptnCLIConfig. Check the length with:

len(mockedCredentialManagerInterface.SetCurrentKeptnCLIConfigCalls())

func (*CredentialManagerInterfaceMock) SetCurrentKubeConfig

func (mock *CredentialManagerInterfaceMock) SetCurrentKubeConfig(kubeConfig credentialmanager.KubeConfigFileType)

SetCurrentKubeConfig calls SetCurrentKubeConfigFunc.

func (*CredentialManagerInterfaceMock) SetCurrentKubeConfigCalls

func (mock *CredentialManagerInterfaceMock) SetCurrentKubeConfigCalls() []struct {
	KubeConfig credentialmanager.KubeConfigFileType
}

SetCurrentKubeConfigCalls gets all the calls that were made to SetCurrentKubeConfig. Check the length with:

len(mockedCredentialManagerInterface.SetCurrentKubeConfigCalls())

func (*CredentialManagerInterfaceMock) SetInstallCreds

func (mock *CredentialManagerInterfaceMock) SetInstallCreds(creds string) error

SetInstallCreds calls SetInstallCredsFunc.

func (*CredentialManagerInterfaceMock) SetInstallCredsCalls

func (mock *CredentialManagerInterfaceMock) SetInstallCredsCalls() []struct {
	Creds string
}

SetInstallCredsCalls gets all the calls that were made to SetInstallCreds. Check the length with:

len(mockedCredentialManagerInterface.SetInstallCredsCalls())

Jump to

Keyboard shortcuts

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