(t *testing.T)
| 1618 | "name": "shared-analytics-metadata", |
| 1619 | "key": "dsn" |
| 1620 | } |
| 1621 | }`) |
| 1622 | |
| 1623 | req := httptest.NewRequest(http.MethodPut, "/api/v1/orgs/analytics/warehouse", bytes.NewReader(body)) |
| 1624 | req.Header.Set("Content-Type", "application/json") |
| 1625 | rec := httptest.NewRecorder() |
| 1626 | router.ServeHTTP(rec, req) |
| 1627 | |
| 1628 | if rec.Code != http.StatusBadRequest { |
| 1629 | t.Fatalf("status = %d, want %d: %s", rec.Code, http.StatusBadRequest, rec.Body.String()) |
| 1630 | } |
| 1631 | if !strings.Contains(rec.Body.String(), "must start with") { |
| 1632 | t.Fatalf("expected org prefix validation error, got %s", rec.Body.String()) |
| 1633 | } |
| 1634 | } |
| 1635 | |
| 1636 | func TestCreateOrgRejectsNestedWarehousePayload(t *testing.T) { |
| 1637 | store := newFakeAPIStore() |
| 1638 | router := newTestAPIRouter(store) |
| 1639 | |
| 1640 | body := []byte(`{ |
| 1641 | "name": "analytics", |
| 1642 | "max_workers": 4, |
| 1643 | "warehouse": { |
| 1644 | "state": "ready" |
| 1645 | } |
| 1646 | }`) |
nothing calls this directly
no test coverage detected