JUnit 5 Architecture
1. Inspect Before Restructuring
- Inspect current package layout, test naming, build filters, and fixture reuse.
- Inspect whether the repo already separates fast and slow tests by tag, source set, or naming convention.
- Read references/suite-shape.md before moving files or changing naming conventions.
2. Choose Stable Boundaries
- Separate component, slice, integration, and service tests intentionally.
- Keep reusable setup close to its owning layer.
- Prefer builders, helpers, and local fixtures before introducing global abstractions.
- Use extensions only when reuse is real and cross-cutting.
3. Refactor for Clarity
- Group tests by behavior or domain concept, not by incidental helper reuse.
- Keep naming consistent with build-tool discovery.
- Avoid base-class pyramids and magical test inheritance.
4. Troubleshooting
- Problem: Shared fixtures leak across unrelated suites. Fix: Push fixtures down to the owning package or convert them to explicit helpers.
- Problem: Test names and package layout hide runtime cost. Fix: Separate slow integration or service suites clearly by tag or naming.