(t *testing.T)
| 385 | } |
| 386 | |
| 387 | func 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 | |
| 414 | func TestAPICounts(t *testing.T) { |
| 415 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected