(t *testing.T)
| 212 | // for a missing row, refusal on the last team (an org must always have at |
| 213 | // least one). |
| 214 | func (s *fakeStore) DeleteOrgTeam(orgID string, teamID int64) error { |
| 215 | if _, ok := s.teams[orgID][teamID]; !ok { |
| 216 | return configstore.ErrOrgTeamNotFound |
| 217 | } |
| 218 | if len(s.teams[orgID]) == 1 { |
| 219 | return configstore.ErrLastOrgTeam |
| 220 | } |
| 221 | delete(s.teams[orgID], teamID) |
| 222 | return nil |
| 223 | } |
| 224 | |
| 225 | func (s *fakeStore) Provision(req ProvisionRequest) error { |
| 226 | reqCopy := req |
| 227 | s.lastProvision = &reqCopy |
| 228 | // Pre-check: warehouse already exists in non-terminal state? Mirrors |
| 229 | // createPendingWarehouseTx so the handler's 409 branch is exercised. |
| 230 | if existing, ok := s.warehouses[req.OrgID]; ok && |
| 231 | existing.State != configstore.ManagedWarehouseStateFailed && |
| 232 | existing.State != configstore.ManagedWarehouseStateDeleted { |
| 233 | return ErrWarehouseNonTerminal |
| 234 | } |
| 235 | |
| 236 | // Stage the writes into shadow maps so a mid-step failure can roll |
nothing calls this directly
no test coverage detected