MCPcopy
hub / github.com/linkedin/Burrow / TestHttpServer_configMain

Function TestHttpServer_configMain

core/internal/httpserver/config_test.go:35–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func 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
57func TestHttpServer_configStorageList(t *testing.T) {
58 coordinator := fixtureConfiguredCoordinator()

Callers

nothing calls this directly

Calls 3

setupConfigurationFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected