Documentation
¶
Index ¶
- func AssertRequest(t *testing.T, r *http.Request, method string, ...)
- func LoadTestDataFile(t *testing.T, filename string) []byte
- func NewHTTPTestServer(t *testing.T, routes []HTTPTestRoute) *httptest.Server
- func ServeJSONTestDataHandler(t *testing.T, statusCode int, filename string) http.HandlerFunc
- type HTTPTestRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertRequest ¶
func AssertRequest(t *testing.T, r *http.Request, method string, expectedHeaders map[string]string, expectedQueryParams map[string]string)
Validates that an HTTP request matches the expected method, headers, and query parameters.
func NewHTTPTestServer ¶
func NewHTTPTestServer(t *testing.T, routes []HTTPTestRoute) *httptest.Server
Types ¶
type HTTPTestRoute ¶
type HTTPTestRoute struct {
Method string
URL string // URL pattern (e.g., "/api/v1"). Must not be empty.
Handler http.HandlerFunc
}
Click to show internal directories.
Click to hide internal directories.