WithBaseMockClient is a test helper that allows you to inject a mock client for testing. It is identical to [WithMockClient], but does not mock the "/_ping" endpoint, and doesn't set the default headers.
(doer func(*http.Request) (*http.Response, error))
| 126 | // for testing. It is identical to [WithMockClient], but does not mock the "/_ping" |
| 127 | // endpoint, and doesn't set the default headers. |
| 128 | func WithBaseMockClient(doer func(*http.Request) (*http.Response, error)) Opt { |
| 129 | return WithHTTPClient(&http.Client{ |
| 130 | Transport: ensureBody(doer), |
| 131 | }) |
| 132 | } |
| 133 | |
| 134 | func errorMock(statusCode int, message string) func(req *http.Request) (*http.Response, error) { |
| 135 | return mockJSONResponse(statusCode, nil, common.ErrorResponse{ |
no test coverage detected
searching dependent graphs…