{"modulePath":"github.com/mattermost/mattermost-plugin-github","version":"v1.0.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package testutils\n\n## Constants\n\n```go\nconst (\n\t// ContentTypeJSON string associated with content-type json\n\tContentTypeJSON contentType = \"application/json\"\n\n\t// ContentTypeHTML string associated with content-type html\n\tContentTypeHTML contentType = \"text/html\"\n\n\t// ContentTypePlain\n\tContentTypePlain contentType = \"text/plain; charset=utf-8\"\n)\n```\n\n## Functions\n\n```go\nfunc EncodeJSON(data interface{}) ([]byte, error)\n```\nEncodeJSON encodes json data in bytes\n\n```go\nfunc EncodeString(data interface{}) ([]byte, error)\n```\nEncodeJSON encodes json data in bytes\n\n## Types\n\n```go\ntype ExpectedResponse struct {\n\tStatusCode   int\n\tResponseType contentType\n\tBody         interface{}\n}\n```\nExpectedResponse stores expected response basic data\n\n```go\ntype HTTPTest struct {\n\t*testing.T\n\tEncoder func(interface{}) ([]byte, error)\n}\n```\nHTTPTest encapsulates data for testing needs\n\n```go\nfunc (test *HTTPTest) CompareHTTPResponse(rr *httptest.ResponseRecorder, expected ExpectedResponse)\n```\nCompareHTTPResponse compares expected response with real one\n\n```go\nfunc (test *HTTPTest) CreateHTTPRequest(request Request) *http.Request\n```\nCreateHTTPRequest creates http Request with basic data\n\n```go\ntype Request struct {\n\tMethod string\n\tURL    string\n\tBody   interface{}\n}\n```\nRequest stores http Request basic data\n\n","path":"github.com/mattermost/mattermost-plugin-github/server/testutils","name":"testutils","synopsis":"","isRedistributable":true}
