(t *testing.T)
| 1643 | "warehouse": { |
| 1644 | "state": "ready" |
| 1645 | } |
| 1646 | }`) |
| 1647 | |
| 1648 | req := httptest.NewRequest(http.MethodPost, "/api/v1/orgs", bytes.NewReader(body)) |
| 1649 | req.Header.Set("Content-Type", "application/json") |
| 1650 | rec := httptest.NewRecorder() |
| 1651 | router.ServeHTTP(rec, req) |
| 1652 | |
| 1653 | if rec.Code != http.StatusBadRequest { |
| 1654 | t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusBadRequest, rec.Body.String()) |
| 1655 | } |
| 1656 | if _, ok := store.orgs["analytics"]; ok { |
| 1657 | t.Fatal("expected org create to be rejected when warehouse payload is present") |
| 1658 | } |
| 1659 | } |
| 1660 | |
| 1661 | func TestUpdateOrgRejectsNestedWarehousePayload(t *testing.T) { |
| 1662 | store := newFakeAPIStore() |
| 1663 | store.orgs["analytics"] = &configstore.Org{Name: "analytics", MaxWorkers: 2} |
| 1664 | router := newTestAPIRouter(store) |
| 1665 | |
| 1666 | body := []byte(`{ |
| 1667 | "max_workers": 4, |
| 1668 | "warehouse": { |
| 1669 | "state": "ready" |
| 1670 | } |
| 1671 | }`) |
nothing calls this directly
no test coverage detected