MCPcopy Create free account
hub / github.com/buggregator/server / TestAPIServiceMap

Function TestAPIServiceMap

modules/sentry/api_test.go:387–412  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

385}
386
387func TestAPIServiceMap(t *testing.T) {
388 mux := http.NewServeMux()
389 seedTestData(t, mux)
390
391 req := httptest.NewRequest("GET", "/api/sentry/service-map", nil)
392 w := httptest.NewRecorder()
393 mux.ServeHTTP(w, req)
394
395 if w.Code != 200 {
396 t.Fatalf("status = %d, want 200", w.Code)
397 }
398
399 var resp map[string]any
400 json.Unmarshal(w.Body.Bytes(), &resp)
401
402 // Should have nodes and edges from the span data.
403 if resp["nodes"] == nil {
404 t.Error("expected nodes")
405 }
406 if resp["edges"] == nil {
407 t.Error("expected edges")
408 }
409 if resp["window_minutes"] == nil {
410 t.Error("expected window_minutes")
411 }
412}
413
414func TestAPICounts(t *testing.T) {
415 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 2

seedTestDataFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected