Documentation
¶
Index ¶
- type ManagerMock
- func (mock *ManagerMock) EnsureRunning(ctx context.Context) error
- func (mock *ManagerMock) EnsureRunningCalls() []struct{ ... }
- func (mock *ManagerMock) IsRunning(ctx context.Context) (bool, error)
- func (mock *ManagerMock) IsRunningCalls() []struct{ ... }
- func (mock *ManagerMock) ProbeHealthz(ctx context.Context) (int, error)
- func (mock *ManagerMock) ProbeHealthzCalls() []struct{ ... }
- func (mock *ManagerMock) Stop(ctx context.Context) error
- func (mock *ManagerMock) StopCalls() []struct{ ... }
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())
Click to show internal directories.
Click to hide internal directories.