(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestHandlerRejectsBadJSON(t *testing.T) { |
| 25 | h := Handler(NewVerifier(nil, nil), NewConsumer(nil, nil)) |
| 26 | r := httptest.NewRequest(http.MethodPost, "/x", strings.NewReader("{not json")) |
| 27 | w := httptest.NewRecorder() |
| 28 | h(w, r) |
| 29 | if w.Code != http.StatusBadRequest { |
| 30 | t.Fatalf("bad json: status=%d, want 400", w.Code) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestHandlerRejectsGET(t *testing.T) { |
| 35 | h := Handler(NewVerifier(nil, nil), NewConsumer(nil, nil)) |
nothing calls this directly
no test coverage detected