(t *testing.T)
| 378 | } |
| 379 | |
| 380 | func newTestAPIRouter(store apiStore) *gin.Engine { |
| 381 | gin.SetMode(gin.TestMode) |
| 382 | r := gin.New() |
| 383 | registerAPIWithStore(r.Group("/api/v1"), store, nil, nil) |
| 384 | return r |
| 385 | } |
| 386 | |
| 387 | // newTestAPIRouterWithFetcher is newTestAPIRouter plus a PeerFetcher, for |
| 388 | // tests asserting the create/update/delete user reload + peer fan-out. |
| 389 | func newTestAPIRouterWithFetcher(store apiStore, fetcher PeerFetcher) *gin.Engine { |
| 390 | gin.SetMode(gin.TestMode) |
| 391 | r := gin.New() |
| 392 | registerAPIWithStore(r.Group("/api/v1"), store, nil, fetcher) |
| 393 | return r |
| 394 | } |
| 395 | |
| 396 | func seedOrgWithWarehouse(store *fakeAPIStore, name string) { |
| 397 | warehouse := &configstore.ManagedWarehouse{ |
| 398 | OrgID: name, |
| 399 | DucklingName: name, |
| 400 | WarehouseDatabase: configstore.ManagedWarehouseDatabase{ |
| 401 | Endpoint: fmt.Sprintf("%s.cluster.example", name), |
| 402 | Port: 5432, |
| 403 | }, |
nothing calls this directly
no test coverage detected