Lesson 17 · Senior v2 architecture
Testing the hexagon
How the architecture should make testing simpler: what to mock at each layer, what a healthy seam looks like, and how to review test strategy like an architect.
Your win: explain the repo’s layered mock strategy, why ports exist partly for testability, and how to tell whether a module’s seams are helping or hurting the test story.
The problem: bad seams make bad tests
When a module hides its real dependencies, uses concrete infra in the core, or mixes transport and business logic together, the testing pain shows up immediately. That pain is often the earliest signal that the architecture boundary is not doing its job.
What a healthy test story looks like here
Eureka’s conventions document makes the layering explicit. Spike and notification also reflect it in practice through handler dependencies declared as interfaces and thin controller layers. The deeper lesson is that testability is not a bonus after architecture — it is one way architecture proves it is real.
Eureka v2 conventions — mock strategy by layer
This is the clearest local articulation of the testing model behind the architecture.
→ .claude/rules/eureka-v2-conventions.md
Check yourself (from memory)
Q1. In a usecase test, the normal thing to mock is…
Sources. Eureka v2 conventions.