Documentation
¶
Overview ¶
Package starrtest provides methods that are shared by all the tests in the other sub packages.
Index ¶
Constants ¶
View Source
const ( BodyUnauthorized = `{"error": "Unauthorized"}` // Error body for 404 response. BodyNotFound = `{"message": "NotFound"}` // Error body for 405 response. BodyMethodNotAllowed = `{"message": "MethodNotAllowed"}` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockData ¶
type MockData struct {
// A name for the test.
Name string
// The path expected in the request ie. /api/v1/thing
ExpectedPath string
// The request body (json) expected from the caller.
ExpectedRequest string
// The request method (GET/POST) expected from the caller.
ExpectedMethod string
// This is the status that gets returned the caller.
ResponseStatus int
// The (json) response body returned to caller.
ResponseBody string
// Caller's request.
WithRequest interface{}
// Caller's response.
WithResponse interface{}
// Caller's response.
WithError error
}
MockData allows generic testing of http inputs and outputs. This is used by the submodule tests.
Click to show internal directories.
Click to hide internal directories.