(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestConsumeRuntimeCallAPI_NonJSONHTTPError(t *testing.T) { |
| 80 | r := newTestConsumeRuntime(stubRoundTripper{respond: stubResponse(http.StatusNotFound, "text/plain", "gone")}) |
| 81 | _, err := r.CallAPI(context.Background(), "GET", "/open-apis/event/v1/connection", nil) |
| 82 | requireCallAPIProblem(t, err, errs.CategoryInternal, errs.SubtypeInvalidResponse) |
| 83 | if !strings.Contains(err.Error(), "returned 404") { |
| 84 | t.Errorf("error should echo the HTTP status, got: %v", err) |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | func TestConsumeRuntimeCallAPI_NonJSONHTTPErrorTruncatesLongBody(t *testing.T) { |
| 89 | long := strings.Repeat("x", 300) |
nothing calls this directly
no test coverage detected