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

Function TestHttpServer_configClusterList

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

Source from the content-addressed store, hash-verified

103}
104
105func 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
129func TestHttpServer_configEvaluatorList(t *testing.T) {
130 coordinator := fixtureConfiguredCoordinator()

Callers

nothing calls this directly

Calls 3

setupConfigurationFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected