MCPcopy Create free account
hub / github.com/astercloud/aster / TestServerHealth

Function TestServerHealth

server/server_test.go:81–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

79}
80
81func TestServerHealth(t *testing.T) {
82 srv, cleanup := setupTestServer(t)
83 defer cleanup()
84
85 req := httptest.NewRequest(http.MethodGet, "/health", nil)
86 w := httptest.NewRecorder()
87
88 srv.Router().ServeHTTP(w, req)
89
90 assert.Equal(t, http.StatusOK, w.Code)
91 assert.Contains(t, w.Body.String(), "healthy")
92}
93
94func TestServerMetrics(t *testing.T) {
95 srv, cleanup := setupTestServer(t)

Callers

nothing calls this directly

Calls 4

setupTestServerFunction · 0.85
ServeHTTPMethod · 0.45
RouterMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected