Commit b7ca3bd
committed
refactor(api): access orchestrator through an interface
APIStore held the concrete *orchestrator.Orchestrator, which cannot be
constructed in a unit test, so handler paths that call the orchestrator
(the snapshot fallbacks in get/connect/resume) were untestable. Introduce
a sandboxOrchestrator interface (composed of focused sandboxOps and node
role interfaces) covering the methods the handlers use, and hold it on
APIStore. A compile-time assertion keeps the concrete type in sync, and
mockery generates a mock for handler tests. No behavior change.1 parent 6b8bf29 commit b7ca3bd
4 files changed
Lines changed: 1221 additions & 1 deletion
File tree
- packages/api/internal/handlers
- mocks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
0 commit comments