mocks

package
v0.12.7 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: AGPL-3.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 ManagerMock

type ManagerMock struct {
	// EnsureRunningFunc mocks the EnsureRunning method.
	EnsureRunningFunc func(ctx context.Context) error

	// IsRunningFunc mocks the IsRunning method.
	IsRunningFunc func(ctx context.Context) (bool, error)

	// ProbeHealthzFunc mocks the ProbeHealthz method.
	ProbeHealthzFunc func(ctx context.Context) (int, error)

	// StopFunc mocks the Stop method.
	StopFunc func(ctx context.Context) error
	// contains filtered or unexported fields
}

ManagerMock is a mock implementation of manager.Manager.

func TestSomethingThatUsesManager(t *testing.T) {

	// make and configure a mocked manager.Manager
	mockedManager := &ManagerMock{
		EnsureRunningFunc: func(ctx context.Context) error {
			panic("mock out the EnsureRunning method")
		},
		IsRunningFunc: func(ctx context.Context) (bool, error) {
			panic("mock out the IsRunning method")
		},
		ProbeHealthzFunc: func(ctx context.Context) (int, error) {
			panic("mock out the ProbeHealthz method")
		},
		StopFunc: func(ctx context.Context) error {
			panic("mock out the Stop method")
		},
	}

	// use mockedManager in code that requires manager.Manager
	// and then make assertions.

}

func (*ManagerMock) EnsureRunning

func (mock *ManagerMock) EnsureRunning(ctx context.Context) error

EnsureRunning calls EnsureRunningFunc.

func (*ManagerMock) EnsureRunningCalls

func (mock *ManagerMock) EnsureRunningCalls() []struct {
	Ctx context.Context
}

EnsureRunningCalls gets all the calls that were made to EnsureRunning. Check the length with:

len(mockedManager.EnsureRunningCalls())

func (*ManagerMock) IsRunning

func (mock *ManagerMock) IsRunning(ctx context.Context) (bool, error)

IsRunning calls IsRunningFunc.

func (*ManagerMock) IsRunningCalls

func (mock *ManagerMock) IsRunningCalls() []struct {
	Ctx context.Context
}

IsRunningCalls gets all the calls that were made to IsRunning. Check the length with:

len(mockedManager.IsRunningCalls())

func (*ManagerMock) ProbeHealthz

func (mock *ManagerMock) ProbeHealthz(ctx context.Context) (int, error)

ProbeHealthz calls ProbeHealthzFunc.

func (*ManagerMock) ProbeHealthzCalls

func (mock *ManagerMock) ProbeHealthzCalls() []struct {
	Ctx context.Context
}

ProbeHealthzCalls gets all the calls that were made to ProbeHealthz. Check the length with:

len(mockedManager.ProbeHealthzCalls())

func (*ManagerMock) Stop

func (mock *ManagerMock) Stop(ctx context.Context) error

Stop calls StopFunc.

func (*ManagerMock) StopCalls

func (mock *ManagerMock) StopCalls() []struct {
	Ctx context.Context
}

StopCalls gets all the calls that were made to Stop. Check the length with:

len(mockedManager.StopCalls())

Jump to

Keyboard shortcuts

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