Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockHandler ¶
type MockHandler struct { // HandlePhaseFunc mocks the HandlePhase method. HandlePhaseFunc func(ctx context.Context, ctxTrace context.Context, tracer telemetry.ITracer, reconcileObject client.Object, phaseMoqParam apicommon.KeptnPhaseType, reconcilePhase func(phaseCtx context.Context) (apicommon.KeptnState, error)) (phase.PhaseResult, error) // contains filtered or unexported fields }
MockHandler is a mock implementation of phase.IHandler.
func TestSomethingThatUsesIHandler(t *testing.T) { // make and configure a mocked phase.IHandler mockedIHandler := &MockHandler{ HandlePhaseFunc: func(ctx context.Context, ctxTrace context.Context, tracer telemetry.ITracer, reconcileObject client.Object, phaseMoqParam apicommon.KeptnPhaseType, reconcilePhase func(phaseCtx context.Context) (apicommon.KeptnState, error)) (phase.PhaseResult, error) { panic("mock out the HandlePhase method") }, } // use mockedIHandler in code that requires phase.IHandler // and then make assertions. }
func (*MockHandler) HandlePhase ¶
func (mock *MockHandler) HandlePhase(ctx context.Context, ctxTrace context.Context, tracer telemetry.ITracer, reconcileObject client.Object, phaseMoqParam apicommon.KeptnPhaseType, reconcilePhase func(phaseCtx context.Context) (apicommon.KeptnState, error)) (phase.PhaseResult, error)
HandlePhase calls HandlePhaseFunc.
func (*MockHandler) HandlePhaseCalls ¶
func (mock *MockHandler) HandlePhaseCalls() []struct { Ctx context.Context CtxTrace context.Context Tracer telemetry.ITracer ReconcileObject client.Object PhaseMoqParam apicommon.KeptnPhaseType ReconcilePhase func(phaseCtx context.Context) (apicommon.KeptnState, error) }
HandlePhaseCalls gets all the calls that were made to HandlePhase. Check the length with:
len(mockedIHandler.HandlePhaseCalls())
Click to show internal directories.
Click to hide internal directories.