Documentation ¶
Overview ¶
Package mockagent is a generated GoMock package.
Package agentharness is a testing framework to mock any RPC agent based on it's DDL ¶
All actions declared in the DDL will be mocked using gomock, expectations can be set using the Stub() method
See the harness test integration suite for an example
Index ¶
- type ActionMiddleware
- type AgentHarness
- func New(fw inter.Framework, ctl *gomock.Controller, name string, ddl *addl.DDL) (*AgentHarness, error)
- func NewWithDDLBytes(fw inter.Framework, ctl *gomock.Controller, name string, ddlBytes []byte) (*AgentHarness, error)
- func NewWithDDLFile(fw inter.Framework, ctl *gomock.Controller, name string, ddlFile string) (*AgentHarness, error)
- type MockActionMiddleware
- type MockActionMiddlewareMockRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionMiddleware ¶
type AgentHarness ¶
type AgentHarness struct {
// contains filtered or unexported fields
}
func New ¶
func New(fw inter.Framework, ctl *gomock.Controller, name string, ddl *addl.DDL) (*AgentHarness, error)
New creates a new test harness with all the actions found in ddl mocked using gomock
func NewWithDDLBytes ¶
func NewWithDDLBytes(fw inter.Framework, ctl *gomock.Controller, name string, ddlBytes []byte) (*AgentHarness, error)
NewWithDDLBytes creates a new test harness based on a ddl contained in ddlBytes
func NewWithDDLFile ¶
func NewWithDDLFile(fw inter.Framework, ctl *gomock.Controller, name string, ddlFile string) (*AgentHarness, error)
NewWithDDLFile creates a new test harness based on a ddl contained on disk
type MockActionMiddleware ¶
type MockActionMiddleware struct {
// contains filtered or unexported fields
}
MockActionMiddleware is a mock of ActionMiddleware interface.
func NewMockActionMiddleware ¶
func NewMockActionMiddleware(ctrl *gomock.Controller) *MockActionMiddleware
NewMockActionMiddleware creates a new mock instance.
func (*MockActionMiddleware) Action ¶
func (m *MockActionMiddleware) Action(ctx context.Context, req *mcorpc.Request, rep *mcorpc.Reply, agent *mcorpc.Agent, conn inter.ConnectorInfo)
Action mocks base method.
func (*MockActionMiddleware) EXPECT ¶
func (m *MockActionMiddleware) EXPECT() *MockActionMiddlewareMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockActionMiddlewareMockRecorder ¶
type MockActionMiddlewareMockRecorder struct {
// contains filtered or unexported fields
}
MockActionMiddlewareMockRecorder is the mock recorder for MockActionMiddleware.