(t *testing.T, method, contentType, body string, expected int)
| 46 | } |
| 47 | |
| 48 | func testHTTPErrorResponse(t *testing.T, method, contentType, body string, expected int) { |
| 49 | request := httptest.NewRequest(method, "http://url.com", strings.NewReader(body)) |
| 50 | request.Header.Set("content-type", contentType) |
| 51 | if code, _ := validateRequest(request); code != expected { |
| 52 | t.Fatalf("response code should be %d not %d", expected, code) |
| 53 | } |
| 54 | } |
no test coverage detected