Documentation
¶
Index ¶
- type DolusExpectationEngine
- func (e *DolusExpectationEngine) AddExpectation(expect expectation.Expectation, validateExpectationSchema bool) error
- func (e *DolusExpectationEngine) GetExpectations(expectationType *expectation.ExpectationType, path *string, method *string) []expectation.Expectation
- func (e *DolusExpectationEngine) GetResponseForRequest(request *http.Request, requestParameters schema.RequestParameters, ...) (*expectation.Response, error)
- func (e *DolusExpectationEngine) GetRouteManager() RouteManager
- func (e *DolusExpectationEngine) SetRouteManager(routeManager RouteManager)
- type ExpectationEngine
- type ExpectationEngineMock
- func (_m *ExpectationEngineMock) AddExpectation(_a0 expectation.Expectation, validateExpectationSchema bool) error
- func (_m *ExpectationEngineMock) EXPECT() *ExpectationEngineMock_Expecter
- func (_m *ExpectationEngineMock) GetExpectations(expectationType *expectation.ExpectationType, path *string, method *string) []expectation.Expectation
- func (_m *ExpectationEngineMock) GetResponseForRequest(request *http.Request, reqParams schema.RequestParameters, path string) (*expectation.Response, error)
- func (_m *ExpectationEngineMock) GetRouteManager() RouteManager
- func (_m *ExpectationEngineMock) SetRouteManager(routeManager RouteManager)
- type ExpectationEngineMock_AddExpectation_Call
- func (_c *ExpectationEngineMock_AddExpectation_Call) Return(_a0 error) *ExpectationEngineMock_AddExpectation_Call
- func (_c *ExpectationEngineMock_AddExpectation_Call) Run(run func(_a0 expectation.Expectation, validateExpectationSchema bool)) *ExpectationEngineMock_AddExpectation_Call
- func (_c *ExpectationEngineMock_AddExpectation_Call) RunAndReturn(run func(expectation.Expectation, bool) error) *ExpectationEngineMock_AddExpectation_Call
- type ExpectationEngineMock_Expecter
- func (_e *ExpectationEngineMock_Expecter) AddExpectation(_a0 interface{}, validateExpectationSchema interface{}) *ExpectationEngineMock_AddExpectation_Call
- func (_e *ExpectationEngineMock_Expecter) GetExpectations(expectationType interface{}, path interface{}, method interface{}) *ExpectationEngineMock_GetExpectations_Call
- func (_e *ExpectationEngineMock_Expecter) GetResponseForRequest(request interface{}, reqParams interface{}, path interface{}) *ExpectationEngineMock_GetResponseForRequest_Call
- func (_e *ExpectationEngineMock_Expecter) GetRouteManager() *ExpectationEngineMock_GetRouteManager_Call
- func (_e *ExpectationEngineMock_Expecter) SetRouteManager(routeManager interface{}) *ExpectationEngineMock_SetRouteManager_Call
- type ExpectationEngineMock_GetExpectations_Call
- func (_c *ExpectationEngineMock_GetExpectations_Call) Return(_a0 []expectation.Expectation) *ExpectationEngineMock_GetExpectations_Call
- func (_c *ExpectationEngineMock_GetExpectations_Call) Run(...) *ExpectationEngineMock_GetExpectations_Call
- func (_c *ExpectationEngineMock_GetExpectations_Call) RunAndReturn(...) *ExpectationEngineMock_GetExpectations_Call
- type ExpectationEngineMock_GetResponseForRequest_Call
- func (_c *ExpectationEngineMock_GetResponseForRequest_Call) Return(_a0 *expectation.Response, _a1 error) *ExpectationEngineMock_GetResponseForRequest_Call
- func (_c *ExpectationEngineMock_GetResponseForRequest_Call) Run(...) *ExpectationEngineMock_GetResponseForRequest_Call
- func (_c *ExpectationEngineMock_GetResponseForRequest_Call) RunAndReturn(...) *ExpectationEngineMock_GetResponseForRequest_Call
- type ExpectationEngineMock_GetRouteManager_Call
- func (_c *ExpectationEngineMock_GetRouteManager_Call) Return(_a0 RouteManager) *ExpectationEngineMock_GetRouteManager_Call
- func (_c *ExpectationEngineMock_GetRouteManager_Call) Run(run func()) *ExpectationEngineMock_GetRouteManager_Call
- func (_c *ExpectationEngineMock_GetRouteManager_Call) RunAndReturn(run func() RouteManager) *ExpectationEngineMock_GetRouteManager_Call
- type ExpectationEngineMock_SetRouteManager_Call
- func (_c *ExpectationEngineMock_SetRouteManager_Call) Return() *ExpectationEngineMock_SetRouteManager_Call
- func (_c *ExpectationEngineMock_SetRouteManager_Call) Run(run func(routeManager RouteManager)) *ExpectationEngineMock_SetRouteManager_Call
- func (_c *ExpectationEngineMock_SetRouteManager_Call) RunAndReturn(run func(RouteManager)) *ExpectationEngineMock_SetRouteManager_Call
- type RouteManager
- type RouteManagerImpl
- func (r *RouteManagerImpl) AddRoute(route schema.Route, routeProperty *schema.RouteProperty)
- func (r *RouteManagerImpl) GetRequestSchema(route schema.Route) dstruct.DynamicStructModifier
- func (r *RouteManagerImpl) GetResponseSchema(route schema.Route) dstruct.DynamicStructModifier
- func (r *RouteManagerImpl) GetRouteProperties() map[schema.Route]*schema.RouteProperty
- func (r *RouteManagerImpl) GetRouteProperty(route schema.Route) *schema.RouteProperty
- func (r *RouteManagerImpl) GetRoutes() []schema.Route
- func (r *RouteManagerImpl) RemoveRoute(route schema.Route)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DolusExpectationEngine ¶
type DolusExpectationEngine struct {
GenerationConfig generator.GenerationConfig
// contains filtered or unexported fields
}
func NewDolusExpectationEngine ¶
func NewDolusExpectationEngine( generationConfig generator.GenerationConfig, ) (dolusExpectationEngine *DolusExpectationEngine)
func (*DolusExpectationEngine) AddExpectation ¶
func (e *DolusExpectationEngine) AddExpectation( expect expectation.Expectation, validateExpectationSchema bool) error
func (*DolusExpectationEngine) GetExpectations ¶
func (e *DolusExpectationEngine) GetExpectations(expectationType *expectation.ExpectationType, path *string, method *string) []expectation.Expectation
func (*DolusExpectationEngine) GetResponseForRequest ¶
func (e *DolusExpectationEngine) GetResponseForRequest( request *http.Request, requestParameters schema.RequestParameters, pathTemplate string, ) (*expectation.Response, error)
GetResponseForRequest returns the response for the given request
func (*DolusExpectationEngine) GetRouteManager ¶
func (e *DolusExpectationEngine) GetRouteManager() RouteManager
GetRouteManager implements ExpectationEngine.
func (*DolusExpectationEngine) SetRouteManager ¶
func (e *DolusExpectationEngine) SetRouteManager(routeManager RouteManager)
SetRouteManager implements ExpectationEngine.
type ExpectationEngine ¶
type ExpectationEngine interface {
// AddExpectation adds an expectation to the engine
AddExpectation(expectation expectation.Expectation,
validateExpectationSchema bool) error
// GetExpectations returns the expectations for the given expectation type. Expectations can be filtered by path, method and expectation type.
GetExpectations(expectationType *expectation.ExpectationType, path *string, method *string) []expectation.Expectation
// GetResponseForRequest returns the response for the given request
GetResponseForRequest(
request *http.Request,
reqParams schema.RequestParameters,
path string,
) (*expectation.Response, error)
// SetRouteManager sets the route manager for the engine
SetRouteManager(routeManager RouteManager)
// GetRouteManager returns the route manager for the engine
GetRouteManager() RouteManager
}
type ExpectationEngineMock ¶
ExpectationEngineMock is an autogenerated mock type for the ExpectationEngine type
func NewExpectationEngineMock ¶
func NewExpectationEngineMock(t interface {
mock.TestingT
Cleanup(func())
}) *ExpectationEngineMock
NewExpectationEngineMock creates a new instance of ExpectationEngineMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*ExpectationEngineMock) AddExpectation ¶
func (_m *ExpectationEngineMock) AddExpectation(_a0 expectation.Expectation, validateExpectationSchema bool) error
AddExpectation provides a mock function with given fields: _a0, validateExpectationSchema
func (*ExpectationEngineMock) EXPECT ¶
func (_m *ExpectationEngineMock) EXPECT() *ExpectationEngineMock_Expecter
func (*ExpectationEngineMock) GetExpectations ¶
func (_m *ExpectationEngineMock) GetExpectations(expectationType *expectation.ExpectationType, path *string, method *string) []expectation.Expectation
GetExpectations provides a mock function with given fields: expectationType, path, method
func (*ExpectationEngineMock) GetResponseForRequest ¶
func (_m *ExpectationEngineMock) GetResponseForRequest(request *http.Request, reqParams schema.RequestParameters, path string) (*expectation.Response, error)
GetResponseForRequest provides a mock function with given fields: request, reqParams, path
func (*ExpectationEngineMock) GetRouteManager ¶
func (_m *ExpectationEngineMock) GetRouteManager() RouteManager
GetRouteManager provides a mock function with given fields:
func (*ExpectationEngineMock) SetRouteManager ¶
func (_m *ExpectationEngineMock) SetRouteManager(routeManager RouteManager)
SetRouteManager provides a mock function with given fields: routeManager
type ExpectationEngineMock_AddExpectation_Call ¶
ExpectationEngineMock_AddExpectation_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddExpectation'
func (*ExpectationEngineMock_AddExpectation_Call) Return ¶
func (_c *ExpectationEngineMock_AddExpectation_Call) Return(_a0 error) *ExpectationEngineMock_AddExpectation_Call
func (*ExpectationEngineMock_AddExpectation_Call) Run ¶
func (_c *ExpectationEngineMock_AddExpectation_Call) Run(run func(_a0 expectation.Expectation, validateExpectationSchema bool)) *ExpectationEngineMock_AddExpectation_Call
func (*ExpectationEngineMock_AddExpectation_Call) RunAndReturn ¶
func (_c *ExpectationEngineMock_AddExpectation_Call) RunAndReturn(run func(expectation.Expectation, bool) error) *ExpectationEngineMock_AddExpectation_Call
type ExpectationEngineMock_Expecter ¶
type ExpectationEngineMock_Expecter struct {
// contains filtered or unexported fields
}
func (*ExpectationEngineMock_Expecter) AddExpectation ¶
func (_e *ExpectationEngineMock_Expecter) AddExpectation(_a0 interface{}, validateExpectationSchema interface{}) *ExpectationEngineMock_AddExpectation_Call
AddExpectation is a helper method to define mock.On call
- _a0 expectation.Expectation
- validateExpectationSchema bool
func (*ExpectationEngineMock_Expecter) GetExpectations ¶
func (_e *ExpectationEngineMock_Expecter) GetExpectations(expectationType interface{}, path interface{}, method interface{}) *ExpectationEngineMock_GetExpectations_Call
GetExpectations is a helper method to define mock.On call
- expectationType *expectation.ExpectationType
- path *string
- method *string
func (*ExpectationEngineMock_Expecter) GetResponseForRequest ¶
func (_e *ExpectationEngineMock_Expecter) GetResponseForRequest(request interface{}, reqParams interface{}, path interface{}) *ExpectationEngineMock_GetResponseForRequest_Call
GetResponseForRequest is a helper method to define mock.On call
- request *http.Request
- reqParams schema.RequestParameters
- path string
func (*ExpectationEngineMock_Expecter) GetRouteManager ¶
func (_e *ExpectationEngineMock_Expecter) GetRouteManager() *ExpectationEngineMock_GetRouteManager_Call
GetRouteManager is a helper method to define mock.On call
func (*ExpectationEngineMock_Expecter) SetRouteManager ¶
func (_e *ExpectationEngineMock_Expecter) SetRouteManager(routeManager interface{}) *ExpectationEngineMock_SetRouteManager_Call
SetRouteManager is a helper method to define mock.On call
- routeManager RouteManager
type ExpectationEngineMock_GetExpectations_Call ¶
ExpectationEngineMock_GetExpectations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetExpectations'
func (*ExpectationEngineMock_GetExpectations_Call) Return ¶
func (_c *ExpectationEngineMock_GetExpectations_Call) Return(_a0 []expectation.Expectation) *ExpectationEngineMock_GetExpectations_Call
func (*ExpectationEngineMock_GetExpectations_Call) Run ¶
func (_c *ExpectationEngineMock_GetExpectations_Call) Run(run func(expectationType *expectation.ExpectationType, path *string, method *string)) *ExpectationEngineMock_GetExpectations_Call
func (*ExpectationEngineMock_GetExpectations_Call) RunAndReturn ¶
func (_c *ExpectationEngineMock_GetExpectations_Call) RunAndReturn(run func(*expectation.ExpectationType, *string, *string) []expectation.Expectation) *ExpectationEngineMock_GetExpectations_Call
type ExpectationEngineMock_GetResponseForRequest_Call ¶
ExpectationEngineMock_GetResponseForRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetResponseForRequest'
func (*ExpectationEngineMock_GetResponseForRequest_Call) Return ¶
func (_c *ExpectationEngineMock_GetResponseForRequest_Call) Return(_a0 *expectation.Response, _a1 error) *ExpectationEngineMock_GetResponseForRequest_Call
func (*ExpectationEngineMock_GetResponseForRequest_Call) Run ¶
func (_c *ExpectationEngineMock_GetResponseForRequest_Call) Run(run func(request *http.Request, reqParams schema.RequestParameters, path string)) *ExpectationEngineMock_GetResponseForRequest_Call
func (*ExpectationEngineMock_GetResponseForRequest_Call) RunAndReturn ¶
func (_c *ExpectationEngineMock_GetResponseForRequest_Call) RunAndReturn(run func(*http.Request, schema.RequestParameters, string) (*expectation.Response, error)) *ExpectationEngineMock_GetResponseForRequest_Call
type ExpectationEngineMock_GetRouteManager_Call ¶
ExpectationEngineMock_GetRouteManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRouteManager'
func (*ExpectationEngineMock_GetRouteManager_Call) Return ¶
func (_c *ExpectationEngineMock_GetRouteManager_Call) Return(_a0 RouteManager) *ExpectationEngineMock_GetRouteManager_Call
func (*ExpectationEngineMock_GetRouteManager_Call) Run ¶
func (_c *ExpectationEngineMock_GetRouteManager_Call) Run(run func()) *ExpectationEngineMock_GetRouteManager_Call
func (*ExpectationEngineMock_GetRouteManager_Call) RunAndReturn ¶
func (_c *ExpectationEngineMock_GetRouteManager_Call) RunAndReturn(run func() RouteManager) *ExpectationEngineMock_GetRouteManager_Call
type ExpectationEngineMock_SetRouteManager_Call ¶
ExpectationEngineMock_SetRouteManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetRouteManager'
func (*ExpectationEngineMock_SetRouteManager_Call) Return ¶
func (_c *ExpectationEngineMock_SetRouteManager_Call) Return() *ExpectationEngineMock_SetRouteManager_Call
func (*ExpectationEngineMock_SetRouteManager_Call) Run ¶
func (_c *ExpectationEngineMock_SetRouteManager_Call) Run(run func(routeManager RouteManager)) *ExpectationEngineMock_SetRouteManager_Call
func (*ExpectationEngineMock_SetRouteManager_Call) RunAndReturn ¶
func (_c *ExpectationEngineMock_SetRouteManager_Call) RunAndReturn(run func(RouteManager)) *ExpectationEngineMock_SetRouteManager_Call
type RouteManager ¶
type RouteManager interface {
// AddRoute registers a new route with the route manager. If the route already exists, it will be overwritten.
AddRoute(route schema.Route,
routeProperty *schema.RouteProperty)
// RemoveRoute removes a route from the manager.
RemoveRoute(route schema.Route)
// GetRoutes returns all the routes registered with the manager.
GetRoutes() []schema.Route
GetRouteProperties() map[schema.Route]*schema.RouteProperty
// GetRouteProperty returns the route property for the given route.
GetRouteProperty(route schema.Route) *schema.RouteProperty
// GetRequestSchema returns the request schema for the given route.
GetRequestSchema(route schema.Route) dstruct.DynamicStructModifier
// GetResponseSchema returns the response schema for the given route.
GetResponseSchema(route schema.Route) dstruct.DynamicStructModifier
}
type RouteManagerImpl ¶
type RouteManagerImpl struct {
// contains filtered or unexported fields
}
func NewRouteManager ¶
func NewRouteManager() *RouteManagerImpl
func (*RouteManagerImpl) AddRoute ¶
func (r *RouteManagerImpl) AddRoute(route schema.Route, routeProperty *schema.RouteProperty)
AddRoute implements RouteManager.
func (*RouteManagerImpl) GetRequestSchema ¶
func (r *RouteManagerImpl) GetRequestSchema(route schema.Route) dstruct.DynamicStructModifier
GetRequestSchema implements RouteManager.
func (*RouteManagerImpl) GetResponseSchema ¶
func (r *RouteManagerImpl) GetResponseSchema(route schema.Route) dstruct.DynamicStructModifier
GetResponseSchema implements RouteManager.
func (*RouteManagerImpl) GetRouteProperties ¶
func (r *RouteManagerImpl) GetRouteProperties() map[schema.Route]*schema.RouteProperty
func (*RouteManagerImpl) GetRouteProperty ¶
func (r *RouteManagerImpl) GetRouteProperty(route schema.Route) *schema.RouteProperty
GetRouteProperty implements RouteManager.
func (*RouteManagerImpl) GetRoutes ¶
func (r *RouteManagerImpl) GetRoutes() []schema.Route
GetRoutes implements RouteManager.
func (*RouteManagerImpl) RemoveRoute ¶
func (r *RouteManagerImpl) RemoveRoute(route schema.Route)
RemoveRoute implements RouteManager.