(t *testing.T)
| 135 | } |
| 136 | |
| 137 | func TestConsumeRuntimeCallAPI_Success(t *testing.T) { |
| 138 | r := newTestConsumeRuntime(stubRoundTripper{respond: stubResponse(http.StatusOK, "application/json", |
| 139 | `{"code":0,"data":{"ok":true}}`)}) |
| 140 | raw, err := r.CallAPI(context.Background(), "GET", "/open-apis/event/v1/connection", nil) |
| 141 | if err != nil { |
| 142 | t.Fatalf("unexpected error: %v", err) |
| 143 | } |
| 144 | if !strings.Contains(string(raw), `"code":0`) { |
| 145 | t.Errorf("raw body should pass through, got: %s", raw) |
| 146 | } |
| 147 | } |
nothing calls this directly
no test coverage detected