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

Function TestHttpServer_configStorageList

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

Source from the content-addressed store, hash-verified

55}
56
57func 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
81func TestHttpServer_configConsumerList(t *testing.T) {
82 coordinator := fixtureConfiguredCoordinator()

Callers

nothing calls this directly

Calls 3

setupConfigurationFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected