TestAdminUpstreamsEmpty verifies that an empty response is valid JSON when no upstreams are registered.
(t *testing.T)
| 115 | // TestAdminUpstreamsEmpty verifies that an empty response is valid JSON when |
| 116 | // no upstreams are registered. |
| 117 | func TestAdminUpstreamsEmpty(t *testing.T) { |
| 118 | resetDynamicHosts() |
| 119 | |
| 120 | results := callAdminUpstreams(t) |
| 121 | if results == nil { |
| 122 | t.Error("expected non-nil (empty) slice, got nil") |
| 123 | } |
| 124 | if len(results) != 0 { |
| 125 | t.Errorf("expected 0 results with empty pools, got %d", len(results)) |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | // TestAdminUpstreamsStaticOnly verifies that static upstreams (from the |
| 130 | // UsagePool) appear in the response with correct addresses. |
nothing calls this directly
no test coverage detected