(t *testing.T)
| 106 | } |
| 107 | |
| 108 | func TestConsumeRuntimeCallAPI_TransportFailure(t *testing.T) { |
| 109 | r := newTestConsumeRuntime(stubRoundTripper{respond: func(*http.Request) (*http.Response, error) { |
| 110 | return nil, errors.New("connection refused") |
| 111 | }}) |
| 112 | _, err := r.CallAPI(context.Background(), "GET", "/open-apis/event/v1/connection", nil) |
| 113 | if err == nil { |
| 114 | t.Fatal("expected error, got nil") |
| 115 | } |
| 116 | p, ok := errs.ProblemOf(err) |
| 117 | if !ok { |
| 118 | t.Fatalf("expected typed errs error, got %T: %v", err, err) |
| 119 | } |
| 120 | if p.Category != errs.CategoryNetwork { |
| 121 | t.Fatalf("category = %s, want %s", p.Category, errs.CategoryNetwork) |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func TestConsumeRuntimeCallAPI_EnvelopeErrorIsTyped(t *testing.T) { |
| 126 | r := newTestConsumeRuntime(stubRoundTripper{respond: stubResponse(http.StatusOK, "application/json", |
nothing calls this directly
no test coverage detected