fake

package
v0.0.0-...-ffc01b6 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveMetricsObjectMock

type ActiveMetricsObjectMock struct {
	// GetActiveMetricsAttributesFunc mocks the GetActiveMetricsAttributes method.
	GetActiveMetricsAttributesFunc func() []attribute.KeyValue

	// IsEndTimeSetFunc mocks the IsEndTimeSet method.
	IsEndTimeSetFunc func() bool
	// contains filtered or unexported fields
}

ActiveMetricsObjectMock is a mock implementation of interfaces.ActiveMetricsObject.

func TestSomethingThatUsesActiveMetricsObject(t *testing.T) {

	// make and configure a mocked interfaces.ActiveMetricsObject
	mockedActiveMetricsObject := &ActiveMetricsObjectMock{
		GetActiveMetricsAttributesFunc: func() []attribute.KeyValue {
			panic("mock out the GetActiveMetricsAttributes method")
		},
		IsEndTimeSetFunc: func() bool {
			panic("mock out the IsEndTimeSet method")
		},
	}

	// use mockedActiveMetricsObject in code that requires interfaces.ActiveMetricsObject
	// and then make assertions.

}

func (*ActiveMetricsObjectMock) GetActiveMetricsAttributes

func (mock *ActiveMetricsObjectMock) GetActiveMetricsAttributes() []attribute.KeyValue

GetActiveMetricsAttributes calls GetActiveMetricsAttributesFunc.

func (*ActiveMetricsObjectMock) GetActiveMetricsAttributesCalls

func (mock *ActiveMetricsObjectMock) GetActiveMetricsAttributesCalls() []struct {
}

GetActiveMetricsAttributesCalls gets all the calls that were made to GetActiveMetricsAttributes. Check the length with:

len(mockedActiveMetricsObject.GetActiveMetricsAttributesCalls())

func (*ActiveMetricsObjectMock) IsEndTimeSet

func (mock *ActiveMetricsObjectMock) IsEndTimeSet() bool

IsEndTimeSet calls IsEndTimeSetFunc.

func (*ActiveMetricsObjectMock) IsEndTimeSetCalls

func (mock *ActiveMetricsObjectMock) IsEndTimeSetCalls() []struct {
}

IsEndTimeSetCalls gets all the calls that were made to IsEndTimeSet. Check the length with:

len(mockedActiveMetricsObject.IsEndTimeSetCalls())

type EventObjectMock

type EventObjectMock struct {
	// GetEventAnnotationsFunc mocks the GetEventAnnotations method.
	GetEventAnnotationsFunc func() map[string]string
	// contains filtered or unexported fields
}

EventObjectMock is a mock implementation of interfaces.EventObject.

func TestSomethingThatUsesEventObject(t *testing.T) {

	// make and configure a mocked interfaces.EventObject
	mockedEventObject := &EventObjectMock{
		GetEventAnnotationsFunc: func() map[string]string {
			panic("mock out the GetEventAnnotations method")
		},
	}

	// use mockedEventObject in code that requires interfaces.EventObject
	// and then make assertions.

}

func (*EventObjectMock) GetEventAnnotations

func (mock *EventObjectMock) GetEventAnnotations() map[string]string

GetEventAnnotations calls GetEventAnnotationsFunc.

func (*EventObjectMock) GetEventAnnotationsCalls

func (mock *EventObjectMock) GetEventAnnotationsCalls() []struct {
}

GetEventAnnotationsCalls gets all the calls that were made to GetEventAnnotations. Check the length with:

len(mockedEventObject.GetEventAnnotationsCalls())

type IMeterMock

type IMeterMock struct {
	// Float64CounterFunc mocks the Float64Counter method.
	Float64CounterFunc func(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error)

	// Float64HistogramFunc mocks the Float64Histogram method.
	Float64HistogramFunc func(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error)

	// Float64ObservableGaugeFunc mocks the Float64ObservableGauge method.
	Float64ObservableGaugeFunc func(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error)

	// Int64CounterFunc mocks the Int64Counter method.
	Int64CounterFunc func(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error)

	// Int64HistogramFunc mocks the Int64Histogram method.
	Int64HistogramFunc func(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error)

	// Int64ObservableGaugeFunc mocks the Int64ObservableGauge method.
	Int64ObservableGaugeFunc func(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error)

	// RegisterCallbackFunc mocks the RegisterCallback method.
	RegisterCallbackFunc func(f metric.Callback, instruments ...metric.Observable) (metric.Registration, error)
	// contains filtered or unexported fields
}

IMeterMock is a mock implementation of interfaces.IMeter.

func TestSomethingThatUsesIMeter(t *testing.T) {

	// make and configure a mocked interfaces.IMeter
	mockedIMeter := &IMeterMock{
		Float64CounterFunc: func(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error) {
			panic("mock out the Float64Counter method")
		},
		Float64HistogramFunc: func(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error) {
			panic("mock out the Float64Histogram method")
		},
		Float64ObservableGaugeFunc: func(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error) {
			panic("mock out the Float64ObservableGauge method")
		},
		Int64CounterFunc: func(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error) {
			panic("mock out the Int64Counter method")
		},
		Int64HistogramFunc: func(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error) {
			panic("mock out the Int64Histogram method")
		},
		Int64ObservableGaugeFunc: func(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error) {
			panic("mock out the Int64ObservableGauge method")
		},
		RegisterCallbackFunc: func(f metric.Callback, instruments ...metric.Observable) (metric.Registration, error) {
			panic("mock out the RegisterCallback method")
		},
	}

	// use mockedIMeter in code that requires interfaces.IMeter
	// and then make assertions.

}

func (*IMeterMock) Float64Counter

func (mock *IMeterMock) Float64Counter(name string, options ...metric.Float64CounterOption) (metric.Float64Counter, error)

Float64Counter calls Float64CounterFunc.

func (*IMeterMock) Float64CounterCalls

func (mock *IMeterMock) Float64CounterCalls() []struct {
	Name    string
	Options []metric.Float64CounterOption
}

Float64CounterCalls gets all the calls that were made to Float64Counter. Check the length with:

len(mockedIMeter.Float64CounterCalls())

func (*IMeterMock) Float64Histogram

func (mock *IMeterMock) Float64Histogram(name string, options ...metric.Float64HistogramOption) (metric.Float64Histogram, error)

Float64Histogram calls Float64HistogramFunc.

func (*IMeterMock) Float64HistogramCalls

func (mock *IMeterMock) Float64HistogramCalls() []struct {
	Name    string
	Options []metric.Float64HistogramOption
}

Float64HistogramCalls gets all the calls that were made to Float64Histogram. Check the length with:

len(mockedIMeter.Float64HistogramCalls())

func (*IMeterMock) Float64ObservableGauge

func (mock *IMeterMock) Float64ObservableGauge(name string, options ...metric.Float64ObservableGaugeOption) (metric.Float64ObservableGauge, error)

Float64ObservableGauge calls Float64ObservableGaugeFunc.

func (*IMeterMock) Float64ObservableGaugeCalls

func (mock *IMeterMock) Float64ObservableGaugeCalls() []struct {
	Name    string
	Options []metric.Float64ObservableGaugeOption
}

Float64ObservableGaugeCalls gets all the calls that were made to Float64ObservableGauge. Check the length with:

len(mockedIMeter.Float64ObservableGaugeCalls())

func (*IMeterMock) Int64Counter

func (mock *IMeterMock) Int64Counter(name string, options ...metric.Int64CounterOption) (metric.Int64Counter, error)

Int64Counter calls Int64CounterFunc.

func (*IMeterMock) Int64CounterCalls

func (mock *IMeterMock) Int64CounterCalls() []struct {
	Name    string
	Options []metric.Int64CounterOption
}

Int64CounterCalls gets all the calls that were made to Int64Counter. Check the length with:

len(mockedIMeter.Int64CounterCalls())

func (*IMeterMock) Int64Histogram

func (mock *IMeterMock) Int64Histogram(name string, options ...metric.Int64HistogramOption) (metric.Int64Histogram, error)

Int64Histogram calls Int64HistogramFunc.

func (*IMeterMock) Int64HistogramCalls

func (mock *IMeterMock) Int64HistogramCalls() []struct {
	Name    string
	Options []metric.Int64HistogramOption
}

Int64HistogramCalls gets all the calls that were made to Int64Histogram. Check the length with:

len(mockedIMeter.Int64HistogramCalls())

func (*IMeterMock) Int64ObservableGauge

func (mock *IMeterMock) Int64ObservableGauge(name string, options ...metric.Int64ObservableGaugeOption) (metric.Int64ObservableGauge, error)

Int64ObservableGauge calls Int64ObservableGaugeFunc.

func (*IMeterMock) Int64ObservableGaugeCalls

func (mock *IMeterMock) Int64ObservableGaugeCalls() []struct {
	Name    string
	Options []metric.Int64ObservableGaugeOption
}

Int64ObservableGaugeCalls gets all the calls that were made to Int64ObservableGauge. Check the length with:

len(mockedIMeter.Int64ObservableGaugeCalls())

func (*IMeterMock) RegisterCallback

func (mock *IMeterMock) RegisterCallback(f metric.Callback, instruments ...metric.Observable) (metric.Registration, error)

RegisterCallback calls RegisterCallbackFunc.

func (*IMeterMock) RegisterCallbackCalls

func (mock *IMeterMock) RegisterCallbackCalls() []struct {
	F           metric.Callback
	Instruments []metric.Observable
}

RegisterCallbackCalls gets all the calls that were made to RegisterCallback. Check the length with:

len(mockedIMeter.RegisterCallbackCalls())

type ListItemMock

type ListItemMock struct {
	// GetItemsFunc mocks the GetItems method.
	GetItemsFunc func() []client.Object
	// contains filtered or unexported fields
}

ListItemMock is a mock implementation of common.ListItem.

func TestSomethingThatUsesListItem(t *testing.T) {

	// make and configure a mocked common.ListItem
	mockedListItem := &ListItemMock{
		GetItemsFunc: func() []client.Object {
			panic("mock out the GetItems method")
		},
	}

	// use mockedListItem in code that requires common.ListItem
	// and then make assertions.

}

func (*ListItemMock) GetItems

func (mock *ListItemMock) GetItems() []client.Object

GetItems calls GetItemsFunc.

func (*ListItemMock) GetItemsCalls

func (mock *ListItemMock) GetItemsCalls() []struct {
}

GetItemsCalls gets all the calls that were made to GetItems. Check the length with:

len(mockedListItem.GetItemsCalls())

type MetricsObjectMock

type MetricsObjectMock struct {
	// GetDurationMetricsAttributesFunc mocks the GetDurationMetricsAttributes method.
	GetDurationMetricsAttributesFunc func() []attribute.KeyValue

	// GetEndTimeFunc mocks the GetEndTime method.
	GetEndTimeFunc func() time.Time

	// GetMetricsAttributesFunc mocks the GetMetricsAttributes method.
	GetMetricsAttributesFunc func() []attribute.KeyValue

	// GetNamespaceFunc mocks the GetNamespace method.
	GetNamespaceFunc func() string

	// GetParentNameFunc mocks the GetParentName method.
	GetParentNameFunc func() string

	// GetPreviousVersionFunc mocks the GetPreviousVersion method.
	GetPreviousVersionFunc func() string

	// GetStartTimeFunc mocks the GetStartTime method.
	GetStartTimeFunc func() time.Time

	// IsEndTimeSetFunc mocks the IsEndTimeSet method.
	IsEndTimeSetFunc func() bool
	// contains filtered or unexported fields
}

MetricsObjectMock is a mock implementation of common.MetricsObject.

func TestSomethingThatUsesMetricsObject(t *testing.T) {

	// make and configure a mocked common.MetricsObject
	mockedMetricsObject := &MetricsObjectMock{
		GetDurationMetricsAttributesFunc: func() []attribute.KeyValue {
			panic("mock out the GetDurationMetricsAttributes method")
		},
		GetEndTimeFunc: func() time.Time {
			panic("mock out the GetEndTime method")
		},
		GetMetricsAttributesFunc: func() []attribute.KeyValue {
			panic("mock out the GetMetricsAttributes method")
		},
		GetNamespaceFunc: func() string {
			panic("mock out the GetNamespace method")
		},
		GetParentNameFunc: func() string {
			panic("mock out the GetParentName method")
		},
		GetPreviousVersionFunc: func() string {
			panic("mock out the GetPreviousVersion method")
		},
		GetStartTimeFunc: func() time.Time {
			panic("mock out the GetStartTime method")
		},
		IsEndTimeSetFunc: func() bool {
			panic("mock out the IsEndTimeSet method")
		},
	}

	// use mockedMetricsObject in code that requires common.MetricsObject
	// and then make assertions.

}

func (*MetricsObjectMock) GetDurationMetricsAttributes

func (mock *MetricsObjectMock) GetDurationMetricsAttributes() []attribute.KeyValue

GetDurationMetricsAttributes calls GetDurationMetricsAttributesFunc.

func (*MetricsObjectMock) GetDurationMetricsAttributesCalls

func (mock *MetricsObjectMock) GetDurationMetricsAttributesCalls() []struct {
}

GetDurationMetricsAttributesCalls gets all the calls that were made to GetDurationMetricsAttributes. Check the length with:

len(mockedMetricsObject.GetDurationMetricsAttributesCalls())

func (*MetricsObjectMock) GetEndTime

func (mock *MetricsObjectMock) GetEndTime() time.Time

GetEndTime calls GetEndTimeFunc.

func (*MetricsObjectMock) GetEndTimeCalls

func (mock *MetricsObjectMock) GetEndTimeCalls() []struct {
}

GetEndTimeCalls gets all the calls that were made to GetEndTime. Check the length with:

len(mockedMetricsObject.GetEndTimeCalls())

func (*MetricsObjectMock) GetMetricsAttributes

func (mock *MetricsObjectMock) GetMetricsAttributes() []attribute.KeyValue

GetMetricsAttributes calls GetMetricsAttributesFunc.

func (*MetricsObjectMock) GetMetricsAttributesCalls

func (mock *MetricsObjectMock) GetMetricsAttributesCalls() []struct {
}

GetMetricsAttributesCalls gets all the calls that were made to GetMetricsAttributes. Check the length with:

len(mockedMetricsObject.GetMetricsAttributesCalls())

func (*MetricsObjectMock) GetNamespace

func (mock *MetricsObjectMock) GetNamespace() string

GetNamespace calls GetNamespaceFunc.

func (*MetricsObjectMock) GetNamespaceCalls

func (mock *MetricsObjectMock) GetNamespaceCalls() []struct {
}

GetNamespaceCalls gets all the calls that were made to GetNamespace. Check the length with:

len(mockedMetricsObject.GetNamespaceCalls())

func (*MetricsObjectMock) GetParentName

func (mock *MetricsObjectMock) GetParentName() string

GetParentName calls GetParentNameFunc.

func (*MetricsObjectMock) GetParentNameCalls

func (mock *MetricsObjectMock) GetParentNameCalls() []struct {
}

GetParentNameCalls gets all the calls that were made to GetParentName. Check the length with:

len(mockedMetricsObject.GetParentNameCalls())

func (*MetricsObjectMock) GetPreviousVersion

func (mock *MetricsObjectMock) GetPreviousVersion() string

GetPreviousVersion calls GetPreviousVersionFunc.

func (*MetricsObjectMock) GetPreviousVersionCalls

func (mock *MetricsObjectMock) GetPreviousVersionCalls() []struct {
}

GetPreviousVersionCalls gets all the calls that were made to GetPreviousVersion. Check the length with:

len(mockedMetricsObject.GetPreviousVersionCalls())

func (*MetricsObjectMock) GetStartTime

func (mock *MetricsObjectMock) GetStartTime() time.Time

GetStartTime calls GetStartTimeFunc.

func (*MetricsObjectMock) GetStartTimeCalls

func (mock *MetricsObjectMock) GetStartTimeCalls() []struct {
}

GetStartTimeCalls gets all the calls that were made to GetStartTime. Check the length with:

len(mockedMetricsObject.GetStartTimeCalls())

func (*MetricsObjectMock) IsEndTimeSet

func (mock *MetricsObjectMock) IsEndTimeSet() bool

IsEndTimeSet calls IsEndTimeSetFunc.

func (*MetricsObjectMock) IsEndTimeSetCalls

func (mock *MetricsObjectMock) IsEndTimeSetCalls() []struct {
}

IsEndTimeSetCalls gets all the calls that were made to IsEndTimeSet. Check the length with:

len(mockedMetricsObject.IsEndTimeSetCalls())

type PhaseItemMock

type PhaseItemMock struct {
	// CompleteFunc mocks the Complete method.
	CompleteFunc func()

	// DeprecateRemainingPhasesFunc mocks the DeprecateRemainingPhases method.
	DeprecateRemainingPhasesFunc func(phase apicommon.KeptnPhaseType)

	// GenerateEvaluationFunc mocks the GenerateEvaluation method.
	GenerateEvaluationFunc func(evaluationDefinition apilifecycle.KeptnEvaluationDefinition, checkType apicommon.CheckType) apilifecycle.KeptnEvaluation

	// GenerateTaskFunc mocks the GenerateTask method.
	GenerateTaskFunc func(taskDefinition apilifecycle.KeptnTaskDefinition, checkType apicommon.CheckType) apilifecycle.KeptnTask

	// GetAppNameFunc mocks the GetAppName method.
	GetAppNameFunc func() string

	// GetCurrentPhaseFunc mocks the GetCurrentPhase method.
	GetCurrentPhaseFunc func() string

	// GetEndTimeFunc mocks the GetEndTime method.
	GetEndTimeFunc func() time.Time

	// GetNamespaceFunc mocks the GetNamespace method.
	GetNamespaceFunc func() string

	// GetParentNameFunc mocks the GetParentName method.
	GetParentNameFunc func() string

	// GetPostDeploymentEvaluationTaskStatusFunc mocks the GetPostDeploymentEvaluationTaskStatus method.
	GetPostDeploymentEvaluationTaskStatusFunc func() []apilifecycle.ItemStatus

	// GetPostDeploymentEvaluationsFunc mocks the GetPostDeploymentEvaluations method.
	GetPostDeploymentEvaluationsFunc func() []string

	// GetPostDeploymentTaskStatusFunc mocks the GetPostDeploymentTaskStatus method.
	GetPostDeploymentTaskStatusFunc func() []apilifecycle.ItemStatus

	// GetPostDeploymentTasksFunc mocks the GetPostDeploymentTasks method.
	GetPostDeploymentTasksFunc func() []string

	// GetPreDeploymentEvaluationTaskStatusFunc mocks the GetPreDeploymentEvaluationTaskStatus method.
	GetPreDeploymentEvaluationTaskStatusFunc func() []apilifecycle.ItemStatus

	// GetPreDeploymentEvaluationsFunc mocks the GetPreDeploymentEvaluations method.
	GetPreDeploymentEvaluationsFunc func() []string

	// GetPreDeploymentTaskStatusFunc mocks the GetPreDeploymentTaskStatus method.
	GetPreDeploymentTaskStatusFunc func() []apilifecycle.ItemStatus

	// GetPreDeploymentTasksFunc mocks the GetPreDeploymentTasks method.
	GetPreDeploymentTasksFunc func() []string

	// GetPreviousVersionFunc mocks the GetPreviousVersion method.
	GetPreviousVersionFunc func() string

	// GetPromotionTaskStatusFunc mocks the GetPromotionTaskStatus method.
	GetPromotionTaskStatusFunc func() []apilifecycle.ItemStatus

	// GetPromotionTasksFunc mocks the GetPromotionTasks method.
	GetPromotionTasksFunc func() []string

	// GetSpanAttributesFunc mocks the GetSpanAttributes method.
	GetSpanAttributesFunc func() []attribute.KeyValue

	// GetStartTimeFunc mocks the GetStartTime method.
	GetStartTimeFunc func() time.Time

	// GetStateFunc mocks the GetState method.
	GetStateFunc func() apicommon.KeptnState

	// GetVersionFunc mocks the GetVersion method.
	GetVersionFunc func() string

	// IsEndTimeSetFunc mocks the IsEndTimeSet method.
	IsEndTimeSetFunc func() bool

	// SetCurrentPhaseFunc mocks the SetCurrentPhase method.
	SetCurrentPhaseFunc func(s string)

	// SetSpanAttributesFunc mocks the SetSpanAttributes method.
	SetSpanAttributesFunc func(span trace.Span)

	// SetStateFunc mocks the SetState method.
	SetStateFunc func(keptnState apicommon.KeptnState)
	// contains filtered or unexported fields
}

PhaseItemMock is a mock implementation of interfaces.PhaseItem.

func TestSomethingThatUsesPhaseItem(t *testing.T) {

	// make and configure a mocked interfaces.PhaseItem
	mockedPhaseItem := &PhaseItemMock{
		CompleteFunc: func()  {
			panic("mock out the Complete method")
		},
		DeprecateRemainingPhasesFunc: func(phase apicommon.KeptnPhaseType)  {
			panic("mock out the DeprecateRemainingPhases method")
		},
		GenerateEvaluationFunc: func(evaluationDefinition apilifecycle.KeptnEvaluationDefinition, checkType apicommon.CheckType) apilifecycle.KeptnEvaluation {
			panic("mock out the GenerateEvaluation method")
		},
		GenerateTaskFunc: func(taskDefinition apilifecycle.KeptnTaskDefinition, checkType apicommon.CheckType) apilifecycle.KeptnTask {
			panic("mock out the GenerateTask method")
		},
		GetAppNameFunc: func() string {
			panic("mock out the GetAppName method")
		},
		GetCurrentPhaseFunc: func() string {
			panic("mock out the GetCurrentPhase method")
		},
		GetEndTimeFunc: func() time.Time {
			panic("mock out the GetEndTime method")
		},
		GetNamespaceFunc: func() string {
			panic("mock out the GetNamespace method")
		},
		GetParentNameFunc: func() string {
			panic("mock out the GetParentName method")
		},
		GetPostDeploymentEvaluationTaskStatusFunc: func() []apilifecycle.ItemStatus {
			panic("mock out the GetPostDeploymentEvaluationTaskStatus method")
		},
		GetPostDeploymentEvaluationsFunc: func() []string {
			panic("mock out the GetPostDeploymentEvaluations method")
		},
		GetPostDeploymentTaskStatusFunc: func() []apilifecycle.ItemStatus {
			panic("mock out the GetPostDeploymentTaskStatus method")
		},
		GetPostDeploymentTasksFunc: func() []string {
			panic("mock out the GetPostDeploymentTasks method")
		},
		GetPreDeploymentEvaluationTaskStatusFunc: func() []apilifecycle.ItemStatus {
			panic("mock out the GetPreDeploymentEvaluationTaskStatus method")
		},
		GetPreDeploymentEvaluationsFunc: func() []string {
			panic("mock out the GetPreDeploymentEvaluations method")
		},
		GetPreDeploymentTaskStatusFunc: func() []apilifecycle.ItemStatus {
			panic("mock out the GetPreDeploymentTaskStatus method")
		},
		GetPreDeploymentTasksFunc: func() []string {
			panic("mock out the GetPreDeploymentTasks method")
		},
		GetPreviousVersionFunc: func() string {
			panic("mock out the GetPreviousVersion method")
		},
		GetPromotionTaskStatusFunc: func() []apilifecycle.ItemStatus {
			panic("mock out the GetPromotionTaskStatus method")
		},
		GetPromotionTasksFunc: func() []string {
			panic("mock out the GetPromotionTasks method")
		},
		GetSpanAttributesFunc: func() []attribute.KeyValue {
			panic("mock out the GetSpanAttributes method")
		},
		GetStartTimeFunc: func() time.Time {
			panic("mock out the GetStartTime method")
		},
		GetStateFunc: func() apicommon.KeptnState {
			panic("mock out the GetState method")
		},
		GetVersionFunc: func() string {
			panic("mock out the GetVersion method")
		},
		IsEndTimeSetFunc: func() bool {
			panic("mock out the IsEndTimeSet method")
		},
		SetCurrentPhaseFunc: func(s string)  {
			panic("mock out the SetCurrentPhase method")
		},
		SetSpanAttributesFunc: func(span trace.Span)  {
			panic("mock out the SetSpanAttributes method")
		},
		SetStateFunc: func(keptnState apicommon.KeptnState)  {
			panic("mock out the SetState method")
		},
	}

	// use mockedPhaseItem in code that requires interfaces.PhaseItem
	// and then make assertions.

}

func (*PhaseItemMock) Complete

func (mock *PhaseItemMock) Complete()

Complete calls CompleteFunc.

func (*PhaseItemMock) CompleteCalls

func (mock *PhaseItemMock) CompleteCalls() []struct {
}

CompleteCalls gets all the calls that were made to Complete. Check the length with:

len(mockedPhaseItem.CompleteCalls())

func (*PhaseItemMock) DeprecateRemainingPhases

func (mock *PhaseItemMock) DeprecateRemainingPhases(phase apicommon.KeptnPhaseType)

DeprecateRemainingPhases calls DeprecateRemainingPhasesFunc.

func (*PhaseItemMock) DeprecateRemainingPhasesCalls

func (mock *PhaseItemMock) DeprecateRemainingPhasesCalls() []struct {
	Phase apicommon.KeptnPhaseType
}

DeprecateRemainingPhasesCalls gets all the calls that were made to DeprecateRemainingPhases. Check the length with:

len(mockedPhaseItem.DeprecateRemainingPhasesCalls())

func (*PhaseItemMock) GenerateEvaluation

func (mock *PhaseItemMock) GenerateEvaluation(evaluationDefinition apilifecycle.KeptnEvaluationDefinition, checkType apicommon.CheckType) apilifecycle.KeptnEvaluation

GenerateEvaluation calls GenerateEvaluationFunc.

func (*PhaseItemMock) GenerateEvaluationCalls

func (mock *PhaseItemMock) GenerateEvaluationCalls() []struct {
	EvaluationDefinition apilifecycle.KeptnEvaluationDefinition
	CheckType            apicommon.CheckType
}

GenerateEvaluationCalls gets all the calls that were made to GenerateEvaluation. Check the length with:

len(mockedPhaseItem.GenerateEvaluationCalls())

func (*PhaseItemMock) GenerateTask

func (mock *PhaseItemMock) GenerateTask(taskDefinition apilifecycle.KeptnTaskDefinition, checkType apicommon.CheckType) apilifecycle.KeptnTask

GenerateTask calls GenerateTaskFunc.

func (*PhaseItemMock) GenerateTaskCalls

func (mock *PhaseItemMock) GenerateTaskCalls() []struct {
	TaskDefinition apilifecycle.KeptnTaskDefinition
	CheckType      apicommon.CheckType
}

GenerateTaskCalls gets all the calls that were made to GenerateTask. Check the length with:

len(mockedPhaseItem.GenerateTaskCalls())

func (*PhaseItemMock) GetAppName

func (mock *PhaseItemMock) GetAppName() string

GetAppName calls GetAppNameFunc.

func (*PhaseItemMock) GetAppNameCalls

func (mock *PhaseItemMock) GetAppNameCalls() []struct {
}

GetAppNameCalls gets all the calls that were made to GetAppName. Check the length with:

len(mockedPhaseItem.GetAppNameCalls())

func (*PhaseItemMock) GetCurrentPhase

func (mock *PhaseItemMock) GetCurrentPhase() string

GetCurrentPhase calls GetCurrentPhaseFunc.

func (*PhaseItemMock) GetCurrentPhaseCalls

func (mock *PhaseItemMock) GetCurrentPhaseCalls() []struct {
}

GetCurrentPhaseCalls gets all the calls that were made to GetCurrentPhase. Check the length with:

len(mockedPhaseItem.GetCurrentPhaseCalls())

func (*PhaseItemMock) GetEndTime

func (mock *PhaseItemMock) GetEndTime() time.Time

GetEndTime calls GetEndTimeFunc.

func (*PhaseItemMock) GetEndTimeCalls

func (mock *PhaseItemMock) GetEndTimeCalls() []struct {
}

GetEndTimeCalls gets all the calls that were made to GetEndTime. Check the length with:

len(mockedPhaseItem.GetEndTimeCalls())

func (*PhaseItemMock) GetNamespace

func (mock *PhaseItemMock) GetNamespace() string

GetNamespace calls GetNamespaceFunc.

func (*PhaseItemMock) GetNamespaceCalls

func (mock *PhaseItemMock) GetNamespaceCalls() []struct {
}

GetNamespaceCalls gets all the calls that were made to GetNamespace. Check the length with:

len(mockedPhaseItem.GetNamespaceCalls())

func (*PhaseItemMock) GetParentName

func (mock *PhaseItemMock) GetParentName() string

GetParentName calls GetParentNameFunc.

func (*PhaseItemMock) GetParentNameCalls

func (mock *PhaseItemMock) GetParentNameCalls() []struct {
}

GetParentNameCalls gets all the calls that were made to GetParentName. Check the length with:

len(mockedPhaseItem.GetParentNameCalls())

func (*PhaseItemMock) GetPostDeploymentEvaluationTaskStatus

func (mock *PhaseItemMock) GetPostDeploymentEvaluationTaskStatus() []apilifecycle.ItemStatus

GetPostDeploymentEvaluationTaskStatus calls GetPostDeploymentEvaluationTaskStatusFunc.

func (*PhaseItemMock) GetPostDeploymentEvaluationTaskStatusCalls

func (mock *PhaseItemMock) GetPostDeploymentEvaluationTaskStatusCalls() []struct {
}

GetPostDeploymentEvaluationTaskStatusCalls gets all the calls that were made to GetPostDeploymentEvaluationTaskStatus. Check the length with:

len(mockedPhaseItem.GetPostDeploymentEvaluationTaskStatusCalls())

func (*PhaseItemMock) GetPostDeploymentEvaluations

func (mock *PhaseItemMock) GetPostDeploymentEvaluations() []string

GetPostDeploymentEvaluations calls GetPostDeploymentEvaluationsFunc.

func (*PhaseItemMock) GetPostDeploymentEvaluationsCalls

func (mock *PhaseItemMock) GetPostDeploymentEvaluationsCalls() []struct {
}

GetPostDeploymentEvaluationsCalls gets all the calls that were made to GetPostDeploymentEvaluations. Check the length with:

len(mockedPhaseItem.GetPostDeploymentEvaluationsCalls())

func (*PhaseItemMock) GetPostDeploymentTaskStatus

func (mock *PhaseItemMock) GetPostDeploymentTaskStatus() []apilifecycle.ItemStatus

GetPostDeploymentTaskStatus calls GetPostDeploymentTaskStatusFunc.

func (*PhaseItemMock) GetPostDeploymentTaskStatusCalls

func (mock *PhaseItemMock) GetPostDeploymentTaskStatusCalls() []struct {
}

GetPostDeploymentTaskStatusCalls gets all the calls that were made to GetPostDeploymentTaskStatus. Check the length with:

len(mockedPhaseItem.GetPostDeploymentTaskStatusCalls())

func (*PhaseItemMock) GetPostDeploymentTasks

func (mock *PhaseItemMock) GetPostDeploymentTasks() []string

GetPostDeploymentTasks calls GetPostDeploymentTasksFunc.

func (*PhaseItemMock) GetPostDeploymentTasksCalls

func (mock *PhaseItemMock) GetPostDeploymentTasksCalls() []struct {
}

GetPostDeploymentTasksCalls gets all the calls that were made to GetPostDeploymentTasks. Check the length with:

len(mockedPhaseItem.GetPostDeploymentTasksCalls())

func (*PhaseItemMock) GetPreDeploymentEvaluationTaskStatus

func (mock *PhaseItemMock) GetPreDeploymentEvaluationTaskStatus() []apilifecycle.ItemStatus

GetPreDeploymentEvaluationTaskStatus calls GetPreDeploymentEvaluationTaskStatusFunc.

func (*PhaseItemMock) GetPreDeploymentEvaluationTaskStatusCalls

func (mock *PhaseItemMock) GetPreDeploymentEvaluationTaskStatusCalls() []struct {
}

GetPreDeploymentEvaluationTaskStatusCalls gets all the calls that were made to GetPreDeploymentEvaluationTaskStatus. Check the length with:

len(mockedPhaseItem.GetPreDeploymentEvaluationTaskStatusCalls())

func (*PhaseItemMock) GetPreDeploymentEvaluations

func (mock *PhaseItemMock) GetPreDeploymentEvaluations() []string

GetPreDeploymentEvaluations calls GetPreDeploymentEvaluationsFunc.

func (*PhaseItemMock) GetPreDeploymentEvaluationsCalls

func (mock *PhaseItemMock) GetPreDeploymentEvaluationsCalls() []struct {
}

GetPreDeploymentEvaluationsCalls gets all the calls that were made to GetPreDeploymentEvaluations. Check the length with:

len(mockedPhaseItem.GetPreDeploymentEvaluationsCalls())

func (*PhaseItemMock) GetPreDeploymentTaskStatus

func (mock *PhaseItemMock) GetPreDeploymentTaskStatus() []apilifecycle.ItemStatus

GetPreDeploymentTaskStatus calls GetPreDeploymentTaskStatusFunc.

func (*PhaseItemMock) GetPreDeploymentTaskStatusCalls

func (mock *PhaseItemMock) GetPreDeploymentTaskStatusCalls() []struct {
}

GetPreDeploymentTaskStatusCalls gets all the calls that were made to GetPreDeploymentTaskStatus. Check the length with:

len(mockedPhaseItem.GetPreDeploymentTaskStatusCalls())

func (*PhaseItemMock) GetPreDeploymentTasks

func (mock *PhaseItemMock) GetPreDeploymentTasks() []string

GetPreDeploymentTasks calls GetPreDeploymentTasksFunc.

func (*PhaseItemMock) GetPreDeploymentTasksCalls

func (mock *PhaseItemMock) GetPreDeploymentTasksCalls() []struct {
}

GetPreDeploymentTasksCalls gets all the calls that were made to GetPreDeploymentTasks. Check the length with:

len(mockedPhaseItem.GetPreDeploymentTasksCalls())

func (*PhaseItemMock) GetPreviousVersion

func (mock *PhaseItemMock) GetPreviousVersion() string

GetPreviousVersion calls GetPreviousVersionFunc.

func (*PhaseItemMock) GetPreviousVersionCalls

func (mock *PhaseItemMock) GetPreviousVersionCalls() []struct {
}

GetPreviousVersionCalls gets all the calls that were made to GetPreviousVersion. Check the length with:

len(mockedPhaseItem.GetPreviousVersionCalls())

func (*PhaseItemMock) GetPromotionTaskStatus

func (mock *PhaseItemMock) GetPromotionTaskStatus() []apilifecycle.ItemStatus

GetPromotionTaskStatus calls GetPromotionTaskStatusFunc.

func (*PhaseItemMock) GetPromotionTaskStatusCalls

func (mock *PhaseItemMock) GetPromotionTaskStatusCalls() []struct {
}

GetPromotionTaskStatusCalls gets all the calls that were made to GetPromotionTaskStatus. Check the length with:

len(mockedPhaseItem.GetPromotionTaskStatusCalls())

func (*PhaseItemMock) GetPromotionTasks

func (mock *PhaseItemMock) GetPromotionTasks() []string

GetPromotionTasks calls GetPromotionTasksFunc.

func (*PhaseItemMock) GetPromotionTasksCalls

func (mock *PhaseItemMock) GetPromotionTasksCalls() []struct {
}

GetPromotionTasksCalls gets all the calls that were made to GetPromotionTasks. Check the length with:

len(mockedPhaseItem.GetPromotionTasksCalls())

func (*PhaseItemMock) GetSpanAttributes

func (mock *PhaseItemMock) GetSpanAttributes() []attribute.KeyValue

GetSpanAttributes calls GetSpanAttributesFunc.

func (*PhaseItemMock) GetSpanAttributesCalls

func (mock *PhaseItemMock) GetSpanAttributesCalls() []struct {
}

GetSpanAttributesCalls gets all the calls that were made to GetSpanAttributes. Check the length with:

len(mockedPhaseItem.GetSpanAttributesCalls())

func (*PhaseItemMock) GetStartTime

func (mock *PhaseItemMock) GetStartTime() time.Time

GetStartTime calls GetStartTimeFunc.

func (*PhaseItemMock) GetStartTimeCalls

func (mock *PhaseItemMock) GetStartTimeCalls() []struct {
}

GetStartTimeCalls gets all the calls that were made to GetStartTime. Check the length with:

len(mockedPhaseItem.GetStartTimeCalls())

func (*PhaseItemMock) GetState

func (mock *PhaseItemMock) GetState() apicommon.KeptnState

GetState calls GetStateFunc.

func (*PhaseItemMock) GetStateCalls

func (mock *PhaseItemMock) GetStateCalls() []struct {
}

GetStateCalls gets all the calls that were made to GetState. Check the length with:

len(mockedPhaseItem.GetStateCalls())

func (*PhaseItemMock) GetVersion

func (mock *PhaseItemMock) GetVersion() string

GetVersion calls GetVersionFunc.

func (*PhaseItemMock) GetVersionCalls

func (mock *PhaseItemMock) GetVersionCalls() []struct {
}

GetVersionCalls gets all the calls that were made to GetVersion. Check the length with:

len(mockedPhaseItem.GetVersionCalls())

func (*PhaseItemMock) IsEndTimeSet

func (mock *PhaseItemMock) IsEndTimeSet() bool

IsEndTimeSet calls IsEndTimeSetFunc.

func (*PhaseItemMock) IsEndTimeSetCalls

func (mock *PhaseItemMock) IsEndTimeSetCalls() []struct {
}

IsEndTimeSetCalls gets all the calls that were made to IsEndTimeSet. Check the length with:

len(mockedPhaseItem.IsEndTimeSetCalls())

func (*PhaseItemMock) SetCurrentPhase

func (mock *PhaseItemMock) SetCurrentPhase(s string)

SetCurrentPhase calls SetCurrentPhaseFunc.

func (*PhaseItemMock) SetCurrentPhaseCalls

func (mock *PhaseItemMock) SetCurrentPhaseCalls() []struct {
	S string
}

SetCurrentPhaseCalls gets all the calls that were made to SetCurrentPhase. Check the length with:

len(mockedPhaseItem.SetCurrentPhaseCalls())

func (*PhaseItemMock) SetSpanAttributes

func (mock *PhaseItemMock) SetSpanAttributes(span trace.Span)

SetSpanAttributes calls SetSpanAttributesFunc.

func (*PhaseItemMock) SetSpanAttributesCalls

func (mock *PhaseItemMock) SetSpanAttributesCalls() []struct {
	Span trace.Span
}

SetSpanAttributesCalls gets all the calls that were made to SetSpanAttributes. Check the length with:

len(mockedPhaseItem.SetSpanAttributesCalls())

func (*PhaseItemMock) SetState

func (mock *PhaseItemMock) SetState(keptnState apicommon.KeptnState)

SetState calls SetStateFunc.

func (*PhaseItemMock) SetStateCalls

func (mock *PhaseItemMock) SetStateCalls() []struct {
	KeptnState apicommon.KeptnState
}

SetStateCalls gets all the calls that were made to SetState. Check the length with:

len(mockedPhaseItem.SetStateCalls())

type SpanItemMock

type SpanItemMock struct {
	// GetSpanKeyFunc mocks the GetSpanKey method.
	GetSpanKeyFunc func(phase string) string

	// GetSpanNameFunc mocks the GetSpanName method.
	GetSpanNameFunc func(phase string) string

	// SetPhaseTraceIDFunc mocks the SetPhaseTraceID method.
	SetPhaseTraceIDFunc func(phase string, carrier propagation.MapCarrier)

	// SetSpanAttributesFunc mocks the SetSpanAttributes method.
	SetSpanAttributesFunc func(span trace.Span)
	// contains filtered or unexported fields
}

SpanItemMock is a mock implementation of interfaces.SpanItem.

func TestSomethingThatUsesSpanItem(t *testing.T) {

	// make and configure a mocked interfaces.SpanItem
	mockedSpanItem := &SpanItemMock{
		GetSpanKeyFunc: func(phase string) string {
			panic("mock out the GetSpanKey method")
		},
		GetSpanNameFunc: func(phase string) string {
			panic("mock out the GetSpanName method")
		},
		SetPhaseTraceIDFunc: func(phase string, carrier propagation.MapCarrier)  {
			panic("mock out the SetPhaseTraceID method")
		},
		SetSpanAttributesFunc: func(span trace.Span)  {
			panic("mock out the SetSpanAttributes method")
		},
	}

	// use mockedSpanItem in code that requires interfaces.SpanItem
	// and then make assertions.

}

func (*SpanItemMock) GetSpanKey

func (mock *SpanItemMock) GetSpanKey(phase string) string

GetSpanKey calls GetSpanKeyFunc.

func (*SpanItemMock) GetSpanKeyCalls

func (mock *SpanItemMock) GetSpanKeyCalls() []struct {
	Phase string
}

GetSpanKeyCalls gets all the calls that were made to GetSpanKey. Check the length with:

len(mockedSpanItem.GetSpanKeyCalls())

func (*SpanItemMock) GetSpanName

func (mock *SpanItemMock) GetSpanName(phase string) string

GetSpanName calls GetSpanNameFunc.

func (*SpanItemMock) GetSpanNameCalls

func (mock *SpanItemMock) GetSpanNameCalls() []struct {
	Phase string
}

GetSpanNameCalls gets all the calls that were made to GetSpanName. Check the length with:

len(mockedSpanItem.GetSpanNameCalls())

func (*SpanItemMock) SetPhaseTraceID

func (mock *SpanItemMock) SetPhaseTraceID(phase string, carrier propagation.MapCarrier)

SetPhaseTraceID calls SetPhaseTraceIDFunc.

func (*SpanItemMock) SetPhaseTraceIDCalls

func (mock *SpanItemMock) SetPhaseTraceIDCalls() []struct {
	Phase   string
	Carrier propagation.MapCarrier
}

SetPhaseTraceIDCalls gets all the calls that were made to SetPhaseTraceID. Check the length with:

len(mockedSpanItem.SetPhaseTraceIDCalls())

func (*SpanItemMock) SetSpanAttributes

func (mock *SpanItemMock) SetSpanAttributes(span trace.Span)

SetSpanAttributes calls SetSpanAttributesFunc.

func (*SpanItemMock) SetSpanAttributesCalls

func (mock *SpanItemMock) SetSpanAttributesCalls() []struct {
	Span trace.Span
}

SetSpanAttributesCalls gets all the calls that were made to SetSpanAttributes. Check the length with:

len(mockedSpanItem.SetSpanAttributesCalls())

Jump to

Keyboard shortcuts

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