Documentation ¶
Overview ¶
go:build test
go:build test
Index ¶
- func AssertAPIResourcesEqual(t *testing.T, exp *types.APIResourceMeta, got *types.APIResourceMeta)
- func AssertResponseError(t *testing.T, rr *httptest.ResponseRecorder, statusCode int, ...)
- func AssertResponseExpected(t *testing.T, rr *httptest.ResponseRecorder, statusCode int, ...)
- func AssertResponseForbidden(t *testing.T, rr *httptest.ResponseRecorder)
- func AssertResponseInternalServerError(t *testing.T, rr *httptest.ResponseRecorder)
- func AssertStatusCode(t *testing.T, rr *httptest.ResponseRecorder, statusCode int)
- func RunAPITest(t *testing.T, test APITestFunc, opts *APITesterOpts, ...)
- type APITestFunc
- type APITester
- type APITesterOpts
- type HandlerInitFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertAPIResourcesEqual ¶
func AssertAPIResourcesEqual(t *testing.T, exp *types.APIResourceMeta, got *types.APIResourceMeta)
func AssertResponseError ¶
func AssertResponseExpected ¶
func AssertResponseExpected(t *testing.T, rr *httptest.ResponseRecorder, statusCode int, expResponse interface{}, gotTarget interface{})
func AssertResponseForbidden ¶
func AssertResponseForbidden(t *testing.T, rr *httptest.ResponseRecorder)
func AssertResponseInternalServerError ¶
func AssertResponseInternalServerError(t *testing.T, rr *httptest.ResponseRecorder)
func AssertStatusCode ¶
func AssertStatusCode(t *testing.T, rr *httptest.ResponseRecorder, statusCode int)
func RunAPITest ¶
func RunAPITest(t *testing.T, test APITestFunc, opts *APITesterOpts, initMethods ...testutils.InitDataFunc)
Types ¶
type APITestFunc ¶
type APITesterOpts ¶
type APITesterOpts struct {
Method, Route string
RequestObj interface{}
HandlerInit HandlerInitFunc
CtxGenerators []GenerateRequestCtx
URLGenerators []GenerateURLParam
BodyGenerators []GenerateBodyParam
}
type HandlerInitFunc ¶
type HandlerInitFunc func( config *server.Config, decoderValidator handlerutils.RequestDecoderValidator, writer handlerutils.ResultWriter, ) http.Handler
Click to show internal directories.
Click to hide internal directories.