(t *testing.T)
| 103 | } |
| 104 | |
| 105 | func TestHttpServer_configClusterList(t *testing.T) { |
| 106 | coordinator := fixtureConfiguredCoordinator() |
| 107 | setupConfiguration() |
| 108 | |
| 109 | // Set up a request |
| 110 | req, err := http.NewRequest("GET", "/v3/config/cluster", http.NoBody) |
| 111 | assert.NoError(t, err, "Expected request setup to return no error") |
| 112 | |
| 113 | // Call the handler via httprouter |
| 114 | rr := httptest.NewRecorder() |
| 115 | coordinator.router.ServeHTTP(rr, req) |
| 116 | |
| 117 | assert.Equalf(t, http.StatusOK, rr.Code, "Expected response code to be 200, not %v", rr.Code) |
| 118 | |
| 119 | // Parse response body |
| 120 | decoder := json.NewDecoder(rr.Body) |
| 121 | var resp httpResponseConfigModuleList |
| 122 | err = decoder.Decode(&resp) |
| 123 | assert.NoError(t, err, "Expected body decode to return no error") |
| 124 | assert.False(t, resp.Error, "Expected response Error to be false") |
| 125 | assert.Equalf(t, "cluster", resp.Coordinator, "Expected Coordinator to be cluster, not %v", resp.Coordinator) |
| 126 | assert.Equalf(t, []string{"testcluster"}, resp.Modules, "Expected Modules to be [testcluster], not %v", resp.Modules) |
| 127 | } |
| 128 | |
| 129 | func TestHttpServer_configEvaluatorList(t *testing.T) { |
| 130 | coordinator := fixtureConfiguredCoordinator() |
nothing calls this directly
no test coverage detected