(t *testing.T)
| 547 | } |
| 548 | |
| 549 | func TestHTTPClient_NilResult(t *testing.T) { |
| 550 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 551 | response := map[string]interface{}{"success": true} |
| 552 | |
| 553 | w.Header().Set("Content-Type", "application/json") |
| 554 | _ = json.NewEncoder(w).Encode(response) |
| 555 | })) |
| 556 | defer server.Close() |
| 557 | |
| 558 | client := NewHTTPClient(server.Client(), server.URL, testutils.NewTestLogger()) |
| 559 | |
| 560 | // Test with nil result - should not error |
| 561 | err := client.Get(context.Background(), "/test", nil) |
| 562 | require.NoError(t, err) |
| 563 | } |
| 564 | |
| 565 | func TestHTTPClient_EmptyResponse(t *testing.T) { |
| 566 | server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected