(t *testing.T, e *gin.Engine, path string)
| 31 | } |
| 32 | |
| 33 | func getJSON(t *testing.T, e *gin.Engine, path string) map[string]any { |
| 34 | t.Helper() |
| 35 | w := httptest.NewRecorder() |
| 36 | req := httptest.NewRequest(http.MethodGet, path, nil) |
| 37 | e.ServeHTTP(w, req) |
| 38 | if w.Code != http.StatusOK { |
| 39 | t.Fatalf("GET %s = %d, want 200 (%s)", path, w.Code, w.Body.String()) |
| 40 | } |
| 41 | var out map[string]any |
| 42 | if err := json.Unmarshal(w.Body.Bytes(), &out); err != nil { |
| 43 | t.Fatalf("GET %s: bad json: %v", path, err) |
| 44 | } |
| 45 | return out |
| 46 | } |
| 47 | |
| 48 | func TestClusterNodesProjection(t *testing.T) { |
| 49 | node := &corev1.Node{ |
no test coverage detected