{"modulePath":"github.com/m3dev/dsps/server","version":"v0.0.0-20220907102720-ef901e443504","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testing\n\n## Functions\n\n```go\nfunc AdminAuthHeaders(t *testing.T, deps *dspshttp.ServerDependencies) map[string]string\n```\nAdminAuthHeaders make HTTP headers for Admin API call\n\n```go\nfunc AssertErrorResponse(t *testing.T, res *http.Response, httpStatus int, dspsError domain.ErrorWithCode, messageRegex string)\n```\nAssertErrorResponse ensure DSPS standard error response\n\n```go\nfunc AssertInternalServerErrorResponse(t *testing.T, res *http.Response)\n```\nAssertInternalServerErrorResponse ensure 500 response\n\n```go\nfunc AssertRecordedCode(t *testing.T, rec *httptest.ResponseRecorder, httpStatusCode int, dspsCode domain.ErrorWithCode)\n```\nAssertRecordedCode assert DSPS standard HTTP error response\n\n```go\nfunc AssertResponseJSON(t *testing.T, res *http.Response, httpStatus int, expected map[string]interface{}) map[string]interface{}\n```\nAssertResponseJSON ensure response body JSON content\n\n```go\nfunc BodyJSONMapOfRec(t *testing.T, rec *httptest.ResponseRecorder) map[string]interface{}\n```\nBodyJSONMapOfRec extract JSON from response body\n\n```go\nfunc BodyJSONMapOfRes(t *testing.T, res *http.Response) map[string]interface{}\n```\nBodyJSONMapOfRes extract JSON from response body\n\n```go\nfunc BodyJSONOfRec(t *testing.T, rec *httptest.ResponseRecorder, body interface{})\n```\nBodyJSONOfRec extract JSON from response body\n\n```go\nfunc BodyJSONOfRes(t *testing.T, res *http.Response, body interface{})\n```\nBodyJSONOfRes extract JSON from response body\n\n```go\nfunc DoHTTPRequest(t *testing.T, method string, url string, body string) *http.Response\n```\nDoHTTPRequest performs HTTP request\n\n```go\nfunc DoHTTPRequestWithHeaders(t *testing.T, method string, url string, headers map[string]string, body string) *http.Response\n```\nDoHTTPRequestWithHeaders performs HTTP request\n\n```go\nfunc NewMockStorages(ctrl *gomock.Controller) (storage *mock.MockStorage, pubsub *mock.MockPubSubStorage, jwts *mock.MockJwtStorage)\n```\nNewMockStorages creates storage mock objects\n\n```go\nfunc WithServer(t *testing.T, configYaml string, setup func(deps *http.ServerDependencies), f func(deps *http.ServerDependencies, baseURL string))\n```\nWithServer runs given test function with HTTP server\n\n```go\nfunc WithServerDeps(t *testing.T, configYaml string, f func(*http.ServerDependencies))\n```\nWithServerDeps runs given test function with ServerDependencies\n\n","path":"github.com/m3dev/dsps/server/http/testing","name":"testing","synopsis":"","isRedistributable":true}
