(t *testing.T)
| 55 | } |
| 56 | |
| 57 | func TestHttpServer_configStorageList(t *testing.T) { |
| 58 | coordinator := fixtureConfiguredCoordinator() |
| 59 | setupConfiguration() |
| 60 | |
| 61 | // Set up a request |
| 62 | req, err := http.NewRequest("GET", "/v3/config/storage", http.NoBody) |
| 63 | assert.NoError(t, err, "Expected request setup to return no error") |
| 64 | |
| 65 | // Call the handler via httprouter |
| 66 | rr := httptest.NewRecorder() |
| 67 | coordinator.router.ServeHTTP(rr, req) |
| 68 | |
| 69 | assert.Equalf(t, http.StatusOK, rr.Code, "Expected response code to be 200, not %v", rr.Code) |
| 70 | |
| 71 | // Parse response body |
| 72 | decoder := json.NewDecoder(rr.Body) |
| 73 | var resp httpResponseConfigModuleList |
| 74 | err = decoder.Decode(&resp) |
| 75 | assert.NoError(t, err, "Expected body decode to return no error") |
| 76 | assert.False(t, resp.Error, "Expected response Error to be false") |
| 77 | assert.Equalf(t, "storage", resp.Coordinator, "Expected Coordinator to be storage, not %v", resp.Coordinator) |
| 78 | assert.Equalf(t, []string{"teststorage"}, resp.Modules, "Expected Modules to be [teststorage], not %v", resp.Modules) |
| 79 | } |
| 80 | |
| 81 | func TestHttpServer_configConsumerList(t *testing.T) { |
| 82 | coordinator := fixtureConfiguredCoordinator() |
nothing calls this directly
no test coverage detected