(t *testing.T)
| 33 | } |
| 34 | |
| 35 | func TestHttpServer_configMain(t *testing.T) { |
| 36 | coordinator := fixtureConfiguredCoordinator() |
| 37 | setupConfiguration() |
| 38 | |
| 39 | // Set up a request |
| 40 | req, err := http.NewRequest("GET", "/v3/config", http.NoBody) |
| 41 | assert.NoError(t, err, "Expected request setup to return no error") |
| 42 | |
| 43 | // Call the handler via httprouter |
| 44 | rr := httptest.NewRecorder() |
| 45 | coordinator.router.ServeHTTP(rr, req) |
| 46 | |
| 47 | assert.Equalf(t, http.StatusOK, rr.Code, "Expected response code to be 200, not %v", rr.Code) |
| 48 | |
| 49 | // Parse response body - just test that it decodes |
| 50 | decoder := json.NewDecoder(rr.Body) |
| 51 | var resp httpResponseConfigMain |
| 52 | err = decoder.Decode(&resp) |
| 53 | assert.NoError(t, err, "Expected body decode to return no error") |
| 54 | assert.False(t, resp.Error, "Expected response Error to be false") |
| 55 | } |
| 56 | |
| 57 | func TestHttpServer_configStorageList(t *testing.T) { |
| 58 | coordinator := fixtureConfiguredCoordinator() |
nothing calls this directly
no test coverage detected