Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndpointProviderMock ¶
type EndpointProviderMock struct { // GetControlPlaneEndpointFunc mocks the GetControlPlaneEndpoint method. GetControlPlaneEndpointFunc func() string // contains filtered or unexported fields }
EndpointProviderMock is a mock implementation of handlers.KeptnControlPlaneEndpointProvider.
func TestSomethingThatUsesKeptnControlPlaneEndpointProvider(t *testing.T) { // make and configure a mocked handlers.KeptnControlPlaneEndpointProvider mockedKeptnControlPlaneEndpointProvider := &EndpointProviderMock{ GetControlPlaneEndpointFunc: func() string { panic("mock out the GetControlPlaneEndpoint method") }, } // use mockedKeptnControlPlaneEndpointProvider in code that requires handlers.KeptnControlPlaneEndpointProvider // and then make assertions. }
func (*EndpointProviderMock) GetControlPlaneEndpoint ¶
func (mock *EndpointProviderMock) GetControlPlaneEndpoint() string
GetControlPlaneEndpoint calls GetControlPlaneEndpointFunc.
func (*EndpointProviderMock) GetControlPlaneEndpointCalls ¶
func (mock *EndpointProviderMock) GetControlPlaneEndpointCalls() []struct { }
GetControlPlaneEndpointCalls gets all the calls that were made to GetControlPlaneEndpoint. Check the length with:
len(mockedKeptnControlPlaneEndpointProvider.GetControlPlaneEndpointCalls())
type EventPublisherMock ¶
type EventPublisherMock struct { // PublishFunc mocks the Publish method. PublishFunc func(event apimodels.KeptnContextExtendedCE) error // contains filtered or unexported fields }
EventPublisherMock is a mock implementation of handlers.eventPublisher.
func TestSomethingThatUseseventPublisher(t *testing.T) { // make and configure a mocked handlers.eventPublisher mockedeventPublisher := &EventPublisherMock{ PublishFunc: func(event apimodels.KeptnContextExtendedCE) error { panic("mock out the Publish method") }, } // use mockedeventPublisher in code that requires handlers.eventPublisher // and then make assertions. }
func (*EventPublisherMock) Publish ¶
func (mock *EventPublisherMock) Publish(event apimodels.KeptnContextExtendedCE) error
Publish calls PublishFunc.
func (*EventPublisherMock) PublishCalls ¶
func (mock *EventPublisherMock) PublishCalls() []struct { Event apimodels.KeptnContextExtendedCE }
PublishCalls gets all the calls that were made to Publish. Check the length with:
len(mockedeventPublisher.PublishCalls())
type MockImportPackageProcessor ¶
type MockImportPackageProcessor struct { // ProcessFunc mocks the Process method. ProcessFunc func(project string, ip importer.ImportPackage) (*model.ManifestExecution, error) // contains filtered or unexported fields }
MockImportPackageProcessor is a mock implementation of handlers.importPackageProcessor.
func TestSomethingThatUsesimportPackageProcessor(t *testing.T) { // make and configure a mocked handlers.importPackageProcessor mockedimportPackageProcessor := &MockImportPackageProcessor{ ProcessFunc: func(project string, ip importer.ImportPackage) (*model.ManifestExecution, error) { panic("mock out the Process method") }, } // use mockedimportPackageProcessor in code that requires handlers.importPackageProcessor // and then make assertions. }
func (*MockImportPackageProcessor) Process ¶
func (mock *MockImportPackageProcessor) Process(project string, ip importer.ImportPackage) (*model.ManifestExecution, error)
Process calls ProcessFunc.
func (*MockImportPackageProcessor) ProcessCalls ¶
func (mock *MockImportPackageProcessor) ProcessCalls() []struct { Project string IP importer.ImportPackage }
ProcessCalls gets all the calls that were made to Process. Check the length with:
len(mockedimportPackageProcessor.ProcessCalls())
type ProjectCheckerMock ¶
type ProjectCheckerMock struct { // ProjectExistsFunc mocks the ProjectExists method. ProjectExistsFunc func(projectName string) (bool, error) // contains filtered or unexported fields }
ProjectCheckerMock is a mock implementation of handlers.projectChecker.
func TestSomethingThatUsesprojectChecker(t *testing.T) { // make and configure a mocked handlers.projectChecker mockedprojectChecker := &ProjectCheckerMock{ ProjectExistsFunc: func(projectName string) (bool, error) { panic("mock out the ProjectExists method") }, } // use mockedprojectChecker in code that requires handlers.projectChecker // and then make assertions. }
func (*ProjectCheckerMock) ProjectExists ¶
func (mock *ProjectCheckerMock) ProjectExists(projectName string) (bool, error)
ProjectExists calls ProjectExistsFunc.
func (*ProjectCheckerMock) ProjectExistsCalls ¶
func (mock *ProjectCheckerMock) ProjectExistsCalls() []struct { ProjectName string }
ProjectExistsCalls gets all the calls that were made to ProjectExists. Check the length with:
len(mockedprojectChecker.ProjectExistsCalls())