Documentation ¶
Overview ¶
This package provides helpers for testing interactions with an HTTP API in the Go (#golang) programming language. It allows you to test that the expected HTTP requests are received by the `httptest.Server`, and return mock responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct { Requests []TestRequest CallCount int T *testing.T }
func NewTLSServer ¶
func (*Handler) AllRequestsCalled ¶
type RequestMatcher ¶
func RequestBodyMatcher ¶
func RequestBodyMatcher(expectedBody string) RequestMatcher
func RequestBodyMatcherWithContentType ¶
func RequestBodyMatcherWithContentType(expectedBody, expectedContentType string) RequestMatcher
type TestRequest ¶
type TestRequest struct { Method string Path string Header http.Header Matcher RequestMatcher Response TestResponse }
Click to show internal directories.
Click to hide internal directories.