Documentation ¶
Index ¶
- type APIV1InterfaceMock
- func (mock *APIV1InterfaceMock) CreateProject(project apimodels.CreateProject) (string, *apimodels.Error)
- func (mock *APIV1InterfaceMock) CreateProjectCalls() []struct{ ... }
- func (mock *APIV1InterfaceMock) CreateService(project string, service apimodels.CreateService) (string, *apimodels.Error)
- func (mock *APIV1InterfaceMock) CreateServiceCalls() []struct{ ... }
- func (mock *APIV1InterfaceMock) DeleteProject(project apimodels.Project) (*apimodels.DeleteProjectResponse, *apimodels.Error)
- func (mock *APIV1InterfaceMock) DeleteProjectCalls() []struct{ ... }
- func (mock *APIV1InterfaceMock) DeleteService(project string, service string) (*apimodels.DeleteServiceResponse, *apimodels.Error)
- func (mock *APIV1InterfaceMock) DeleteServiceCalls() []struct{ ... }
- func (mock *APIV1InterfaceMock) GetMetadata() (*apimodels.Metadata, *apimodels.Error)
- func (mock *APIV1InterfaceMock) GetMetadataCalls() []struct{}
- func (mock *APIV1InterfaceMock) SendEvent(event apimodels.KeptnContextExtendedCE) (*apimodels.EventContext, *apimodels.Error)
- func (mock *APIV1InterfaceMock) SendEventCalls() []struct{ ... }
- func (mock *APIV1InterfaceMock) TriggerEvaluation(project string, stage string, service string, evaluation apimodels.Evaluation) (*apimodels.EventContext, *apimodels.Error)
- func (mock *APIV1InterfaceMock) TriggerEvaluationCalls() []struct{ ... }
- func (mock *APIV1InterfaceMock) UpdateProject(project apimodels.CreateProject) (string, *apimodels.Error)
- func (mock *APIV1InterfaceMock) UpdateProjectCalls() []struct{ ... }
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIV1InterfaceMock ¶
type APIV1InterfaceMock struct { // CreateProjectFunc mocks the CreateProject method. CreateProjectFunc func(project apimodels.CreateProject) (string, *apimodels.Error) // CreateServiceFunc mocks the CreateService method. CreateServiceFunc func(project string, service apimodels.CreateService) (string, *apimodels.Error) // DeleteProjectFunc mocks the DeleteProject method. DeleteProjectFunc func(project apimodels.Project) (*apimodels.DeleteProjectResponse, *apimodels.Error) // DeleteServiceFunc mocks the DeleteService method. DeleteServiceFunc func(project string, service string) (*apimodels.DeleteServiceResponse, *apimodels.Error) // GetMetadataFunc mocks the GetMetadata method. GetMetadataFunc func() (*apimodels.Metadata, *apimodels.Error) // SendEventFunc mocks the SendEvent method. SendEventFunc func(event apimodels.KeptnContextExtendedCE) (*apimodels.EventContext, *apimodels.Error) // TriggerEvaluationFunc mocks the TriggerEvaluation method. TriggerEvaluationFunc func(project string, stage string, service string, evaluation apimodels.Evaluation) (*apimodels.EventContext, *apimodels.Error) // UpdateProjectFunc mocks the UpdateProject method. UpdateProjectFunc func(project apimodels.CreateProject) (string, *apimodels.Error) // contains filtered or unexported fields }
APIV1InterfaceMock is a mock implementation of projectcreator.apiV1Interface.
func TestSomethingThatUsesapiV1Interface(t *testing.T) { // make and configure a mocked projectcreator.apiV1Interface mockedapiV1Interface := &APIV1InterfaceMock{ CreateProjectFunc: func(project apimodels.CreateProject) (string, *apimodels.Error) { panic("mock out the CreateProject method") }, CreateServiceFunc: func(project string, service apimodels.CreateService) (string, *apimodels.Error) { panic("mock out the CreateService method") }, DeleteProjectFunc: func(project apimodels.Project) (*apimodels.DeleteProjectResponse, *apimodels.Error) { panic("mock out the DeleteProject method") }, DeleteServiceFunc: func(project string, service string) (*apimodels.DeleteServiceResponse, *apimodels.Error) { panic("mock out the DeleteService method") }, GetMetadataFunc: func() (*apimodels.Metadata, *apimodels.Error) { panic("mock out the GetMetadata method") }, SendEventFunc: func(event apimodels.KeptnContextExtendedCE) (*apimodels.EventContext, *apimodels.Error) { panic("mock out the SendEvent method") }, TriggerEvaluationFunc: func(project string, stage string, service string, evaluation apimodels.Evaluation) (*apimodels.EventContext, *apimodels.Error) { panic("mock out the TriggerEvaluation method") }, UpdateProjectFunc: func(project apimodels.CreateProject) (string, *apimodels.Error) { panic("mock out the UpdateProject method") }, } // use mockedapiV1Interface in code that requires projectcreator.apiV1Interface // and then make assertions. }
func (*APIV1InterfaceMock) CreateProject ¶
func (mock *APIV1InterfaceMock) CreateProject(project apimodels.CreateProject) (string, *apimodels.Error)
CreateProject calls CreateProjectFunc.
func (*APIV1InterfaceMock) CreateProjectCalls ¶
func (mock *APIV1InterfaceMock) CreateProjectCalls() []struct { Project apimodels.CreateProject }
CreateProjectCalls gets all the calls that were made to CreateProject. Check the length with:
len(mockedapiV1Interface.CreateProjectCalls())
func (*APIV1InterfaceMock) CreateService ¶
func (mock *APIV1InterfaceMock) CreateService(project string, service apimodels.CreateService) (string, *apimodels.Error)
CreateService calls CreateServiceFunc.
func (*APIV1InterfaceMock) CreateServiceCalls ¶
func (mock *APIV1InterfaceMock) CreateServiceCalls() []struct { Project string Service apimodels.CreateService }
CreateServiceCalls gets all the calls that were made to CreateService. Check the length with:
len(mockedapiV1Interface.CreateServiceCalls())
func (*APIV1InterfaceMock) DeleteProject ¶
func (mock *APIV1InterfaceMock) DeleteProject(project apimodels.Project) (*apimodels.DeleteProjectResponse, *apimodels.Error)
DeleteProject calls DeleteProjectFunc.
func (*APIV1InterfaceMock) DeleteProjectCalls ¶
func (mock *APIV1InterfaceMock) DeleteProjectCalls() []struct { Project apimodels.Project }
DeleteProjectCalls gets all the calls that were made to DeleteProject. Check the length with:
len(mockedapiV1Interface.DeleteProjectCalls())
func (*APIV1InterfaceMock) DeleteService ¶
func (mock *APIV1InterfaceMock) DeleteService(project string, service string) (*apimodels.DeleteServiceResponse, *apimodels.Error)
DeleteService calls DeleteServiceFunc.
func (*APIV1InterfaceMock) DeleteServiceCalls ¶
func (mock *APIV1InterfaceMock) DeleteServiceCalls() []struct { Project string Service string }
DeleteServiceCalls gets all the calls that were made to DeleteService. Check the length with:
len(mockedapiV1Interface.DeleteServiceCalls())
func (*APIV1InterfaceMock) GetMetadata ¶
func (mock *APIV1InterfaceMock) GetMetadata() (*apimodels.Metadata, *apimodels.Error)
GetMetadata calls GetMetadataFunc.
func (*APIV1InterfaceMock) GetMetadataCalls ¶
func (mock *APIV1InterfaceMock) GetMetadataCalls() []struct { }
GetMetadataCalls gets all the calls that were made to GetMetadata. Check the length with:
len(mockedapiV1Interface.GetMetadataCalls())
func (*APIV1InterfaceMock) SendEvent ¶
func (mock *APIV1InterfaceMock) SendEvent(event apimodels.KeptnContextExtendedCE) (*apimodels.EventContext, *apimodels.Error)
SendEvent calls SendEventFunc.
func (*APIV1InterfaceMock) SendEventCalls ¶
func (mock *APIV1InterfaceMock) SendEventCalls() []struct { Event apimodels.KeptnContextExtendedCE }
SendEventCalls gets all the calls that were made to SendEvent. Check the length with:
len(mockedapiV1Interface.SendEventCalls())
func (*APIV1InterfaceMock) TriggerEvaluation ¶
func (mock *APIV1InterfaceMock) TriggerEvaluation(project string, stage string, service string, evaluation apimodels.Evaluation) (*apimodels.EventContext, *apimodels.Error)
TriggerEvaluation calls TriggerEvaluationFunc.
func (*APIV1InterfaceMock) TriggerEvaluationCalls ¶
func (mock *APIV1InterfaceMock) TriggerEvaluationCalls() []struct { Project string Stage string Service string Evaluation apimodels.Evaluation }
TriggerEvaluationCalls gets all the calls that were made to TriggerEvaluation. Check the length with:
len(mockedapiV1Interface.TriggerEvaluationCalls())
func (*APIV1InterfaceMock) UpdateProject ¶
func (mock *APIV1InterfaceMock) UpdateProject(project apimodels.CreateProject) (string, *apimodels.Error)
UpdateProject calls UpdateProjectFunc.
func (*APIV1InterfaceMock) UpdateProjectCalls ¶
func (mock *APIV1InterfaceMock) UpdateProjectCalls() []struct { Project apimodels.CreateProject }
UpdateProjectCalls gets all the calls that were made to UpdateProject. Check the length with:
len(mockedapiV1Interface.UpdateProjectCalls())