Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResponseBody ¶
func GetResponseBodyBytes ¶
func UnmarshalResponseBody ¶
func UnmarshalResponseBody(t *testing.T, visitor func(http.ResponseWriter) error, target interface{})
Types ¶
type Handler ¶
type Handler struct {
RequestHeaders http.Header
StatusCode int
RequestData []byte
ResponseData interface{}
}
Handler is a custom http handler useful in testing. Usage:
s := httptest.NewServer(handler{statusCode: http.StatusOK, responseData: someStruct})
Then s.URL must be configured in the client.
Click to show internal directories.
Click to hide internal directories.