(t *testing.T)
| 262 | } |
| 263 | |
| 264 | func TestHandlerError(t *testing.T) { |
| 265 | r := Router(&testService{t}, &testAuthBackend{}) |
| 266 | rec := httptest.NewRecorder() |
| 267 | req := httptest.NewRequest("GET", "/pay/beta/payment-methods", nil) |
| 268 | req.Header.Set("Accept", runtime.JSONAPIContentType) |
| 269 | req.Header.Set("Content-Type", runtime.JSONAPIContentType) |
| 270 | |
| 271 | log.Handler()(r).ServeHTTP(rec, req) |
| 272 | |
| 273 | resp := rec.Result() |
| 274 | defer resp.Body.Close() |
| 275 | |
| 276 | if resp.StatusCode != http.StatusInternalServerError { |
| 277 | t.Errorf("expected 500 got: %d", resp.StatusCode) |
| 278 | b, err := io.ReadAll(resp.Body) |
| 279 | if err != nil { |
| 280 | t.Fatal(err) |
| 281 | } |
| 282 | t.Error(string(b[:])) |
| 283 | } |
| 284 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…