Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockProvider ¶
type MockProvider struct { // GetConfigFunc mocks the GetConfig method. GetConfigFunc func() (*rest.Config, error) // contains filtered or unexported fields }
MockProvider is a mock implementation of config.Provider.
func TestSomethingThatUsesProvider(t *testing.T) { // make and configure a mocked config.Provider mockedProvider := &MockProvider{ GetConfigFunc: func() (*rest.Config, error) { panic("mock out the GetConfig method") }, } // use mockedProvider in code that requires config.Provider // and then make assertions. }
func (*MockProvider) GetConfig ¶
func (mock *MockProvider) GetConfig() (*rest.Config, error)
GetConfig calls GetConfigFunc.
func (*MockProvider) GetConfigCalls ¶
func (mock *MockProvider) GetConfigCalls() []struct { }
GetConfigCalls gets all the calls that were made to GetConfig. Check the length with:
len(mockedProvider.GetConfigCalls())
type MockWebhookManager ¶
type MockWebhookManager struct { // SetupWebhookServerFunc mocks the SetupWebhookServer method. SetupWebhookServerFunc func(mgr manager.Manager) // contains filtered or unexported fields }
MockWebhookManager is a mock implementation of manager.Provider.
func TestSomethingThatUsesProvider(t *testing.T) { // make and configure a mocked manager.Provider mockedProvider := &MockWebhookManager{ SetupWebhookServerFunc: func(mgr manager.Manager) { panic("mock out the SetupWebhookServer method") }, } // use mockedProvider in code that requires manager.Provider // and then make assertions. }
func (*MockWebhookManager) SetupWebhookServer ¶
func (mock *MockWebhookManager) SetupWebhookServer(mgr manager.Manager)
SetupWebhookServer calls SetupWebhookServerFunc.
func (*MockWebhookManager) SetupWebhookServerCalls ¶
func (mock *MockWebhookManager) SetupWebhookServerCalls() []struct { Mgr manager.Manager }
SetupWebhookServerCalls gets all the calls that were made to SetupWebhookServer. Check the length with:
len(mockedProvider.SetupWebhookServerCalls())
Click to show internal directories.
Click to hide internal directories.