fake

package
v0.0.0-...-9d026b8 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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockConfig

type MockConfig struct {
	// GetBlockDeploymentFunc mocks the GetBlockDeployment method.
	GetBlockDeploymentFunc func() bool

	// GetCloudEventsEndpointFunc mocks the GetCloudEventsEndpoint method.
	GetCloudEventsEndpointFunc func() string

	// GetCreationRequestTimeoutFunc mocks the GetCreationRequestTimeout method.
	GetCreationRequestTimeoutFunc func() time.Duration

	// GetDefaultNamespaceFunc mocks the GetDefaultNamespace method.
	GetDefaultNamespaceFunc func() string

	// GetObservabilityTimeoutFunc mocks the GetObservabilityTimeout method.
	GetObservabilityTimeoutFunc func() metav1.Duration

	// SetBlockDeploymentFunc mocks the SetBlockDeployment method.
	SetBlockDeploymentFunc func(value bool)

	// SetCloudEventsEndpointFunc mocks the SetCloudEventsEndpoint method.
	SetCloudEventsEndpointFunc func(endpoint string)

	// SetRestApiEnabledFunc mocks the the SetRestApiEnabled method.
	SetRestApiEnabledFunc func(value bool)

	// GetRestApiFunc mocks the GetRestApiEnabled method.
	GetRestApiEnabledFunc func() bool

	// SetCreationRequestTimeoutFunc mocks the SetCreationRequestTimeout method.
	SetCreationRequestTimeoutFunc func(value time.Duration)

	// SetDefaultNamespaceFunc mocks the SetDefaultNamespace method.
	SetDefaultNamespaceFunc func(namespace string)

	// SetObservabilityTimeoutFunc mocks the SetObservabilityTimeout method.
	SetObservabilityTimeoutFunc func(timeout metav1.Duration)
	// contains filtered or unexported fields
}

MockConfig is a mock implementation of config.IConfig.

func TestSomethingThatUsesIConfig(t *testing.T) {

	// make and configure a mocked config.IConfig
	mockedIConfig := &MockConfig{
		GetBlockDeploymentFunc: func() bool {
			panic("mock out the GetBlockDeployment method")
		},
		GetCloudEventsEndpointFunc: func() string {
			panic("mock out the GetCloudEventsEndpoint method")
		},
		GetCreationRequestTimeoutFunc: func() time.Duration {
			panic("mock out the GetCreationRequestTimeout method")
		},
		GetDefaultNamespaceFunc: func() string {
			panic("mock out the GetDefaultNamespace method")
		},
		GetObservabilityTimeoutFunc: func() metav1.Duration {
			panic("mock out the GetObservabilityTimeout method")
		},
		SetBlockDeploymentFunc: func(value bool)  {
			panic("mock out the SetBlockDeployment method")
		},
		SetCloudEventsEndpointFunc: func(endpoint string)  {
			panic("mock out the SetCloudEventsEndpoint method")
		},
		SetCreationRequestTimeoutFunc: func(value time.Duration)  {
			panic("mock out the SetCreationRequestTimeout method")
		},
		SetDefaultNamespaceFunc: func(namespace string)  {
			panic("mock out the SetDefaultNamespace method")
		},
		SetObservabilityTimeoutFunc: func(timeout metav1.Duration)  {
			panic("mock out the SetObservabilityTimeout method")
		},
	}

	// use mockedIConfig in code that requires config.IConfig
	// and then make assertions.

}

func (*MockConfig) GetBlockDeployment

func (mock *MockConfig) GetBlockDeployment() bool

GetBlockDeployment calls GetBlockDeploymentFunc.

func (*MockConfig) GetBlockDeploymentCalls

func (mock *MockConfig) GetBlockDeploymentCalls() []struct {
}

GetBlockDeploymentCalls gets all the calls that were made to GetBlockDeployment. Check the length with:

len(mockedIConfig.GetBlockDeploymentCalls())

func (*MockConfig) GetCloudEventsEndpoint

func (mock *MockConfig) GetCloudEventsEndpoint() string

GetCloudEventsEndpoint calls GetCloudEventsEndpointFunc.

func (*MockConfig) GetCloudEventsEndpointCalls

func (mock *MockConfig) GetCloudEventsEndpointCalls() []struct {
}

GetCloudEventsEndpointCalls gets all the calls that were made to GetCloudEventsEndpoint. Check the length with:

len(mockedIConfig.GetCloudEventsEndpointCalls())

func (*MockConfig) GetCreationRequestTimeout

func (mock *MockConfig) GetCreationRequestTimeout() time.Duration

GetCreationRequestTimeout calls GetCreationRequestTimeoutFunc.

func (*MockConfig) GetCreationRequestTimeoutCalls

func (mock *MockConfig) GetCreationRequestTimeoutCalls() []struct {
}

GetCreationRequestTimeoutCalls gets all the calls that were made to GetCreationRequestTimeout. Check the length with:

len(mockedIConfig.GetCreationRequestTimeoutCalls())

func (*MockConfig) GetDefaultNamespace

func (mock *MockConfig) GetDefaultNamespace() string

GetDefaultNamespace calls GetDefaultNamespaceFunc.

func (*MockConfig) GetDefaultNamespaceCalls

func (mock *MockConfig) GetDefaultNamespaceCalls() []struct {
}

GetDefaultNamespaceCalls gets all the calls that were made to GetDefaultNamespace. Check the length with:

len(mockedIConfig.GetDefaultNamespaceCalls())

func (*MockConfig) GetObservabilityTimeout

func (mock *MockConfig) GetObservabilityTimeout() metav1.Duration

GetObservabilityTimeout calls GetObservabilityTimeoutFunc.

func (*MockConfig) GetObservabilityTimeoutCalls

func (mock *MockConfig) GetObservabilityTimeoutCalls() []struct {
}

GetObservabilityTimeoutCalls gets all the calls that were made to GetObservabilityTimeout. Check the length with:

len(mockedIConfig.GetObservabilityTimeoutCalls())

func (*MockConfig) GetRestApiEnabled

func (mock *MockConfig) GetRestApiEnabled() bool

GetRestApi calls GetRestApiFunc.

func (*MockConfig) SetBlockDeployment

func (mock *MockConfig) SetBlockDeployment(value bool)

SetBlockDeployment calls SetBlockDeploymentFunc.

func (*MockConfig) SetBlockDeploymentCalls

func (mock *MockConfig) SetBlockDeploymentCalls() []struct {
	Value bool
}

SetBlockDeploymentCalls gets all the calls that were made to SetBlockDeployment. Check the length with:

len(mockedIConfig.SetBlockDeploymentCalls())

func (*MockConfig) SetCloudEventsEndpoint

func (mock *MockConfig) SetCloudEventsEndpoint(endpoint string)

SetCloudEventsEndpoint calls SetCloudEventsEndpointFunc.

func (*MockConfig) SetCloudEventsEndpointCalls

func (mock *MockConfig) SetCloudEventsEndpointCalls() []struct {
	Endpoint string
}

SetCloudEventsEndpointCalls gets all the calls that were made to SetCloudEventsEndpoint. Check the length with:

len(mockedIConfig.SetCloudEventsEndpointCalls())

func (*MockConfig) SetCreationRequestTimeout

func (mock *MockConfig) SetCreationRequestTimeout(value time.Duration)

SetCreationRequestTimeout calls SetCreationRequestTimeoutFunc.

func (*MockConfig) SetCreationRequestTimeoutCalls

func (mock *MockConfig) SetCreationRequestTimeoutCalls() []struct {
	Value time.Duration
}

SetCreationRequestTimeoutCalls gets all the calls that were made to SetCreationRequestTimeout. Check the length with:

len(mockedIConfig.SetCreationRequestTimeoutCalls())

func (*MockConfig) SetDefaultNamespace

func (mock *MockConfig) SetDefaultNamespace(namespace string)

SetDefaultNamespace calls SetDefaultNamespaceFunc.

func (*MockConfig) SetDefaultNamespaceCalls

func (mock *MockConfig) SetDefaultNamespaceCalls() []struct {
	Namespace string
}

SetDefaultNamespaceCalls gets all the calls that were made to SetDefaultNamespace. Check the length with:

len(mockedIConfig.SetDefaultNamespaceCalls())

func (*MockConfig) SetObservabilityTimeout

func (mock *MockConfig) SetObservabilityTimeout(timeout metav1.Duration)

SetObservabilityTimeout calls SetObservabilityTimeoutFunc.

func (*MockConfig) SetObservabilityTimeoutCalls

func (mock *MockConfig) SetObservabilityTimeoutCalls() []struct {
	Timeout metav1.Duration
}

SetObservabilityTimeoutCalls gets all the calls that were made to SetObservabilityTimeout. Check the length with:

len(mockedIConfig.SetObservabilityTimeoutCalls())

func (*MockConfig) SetRestApiEnabled

func (mock *MockConfig) SetRestApiEnabled(value bool)

GetRestApi calls GetRestApiFunc.

Jump to

Keyboard shortcuts

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