What problem does it solve?
It solves the problem of brittle, flaky Kotlin tests by guiding you to set up state predictably with fakes and to drive scenarios through domain behavior instead of direct data manipulation.
Core Features & Use Cases
- Frictionless, readable test setup: Use extension functions on companion objects (Object Mother style) and
.copy() to create consistent domain state quickly.
- Fakes instead of mocks: Prefer HashMap-based fakes that behave like real implementations, enabling state-based assertions without mocking frameworks.
- Testing Through The Domain (TTTD): Populate and verify system state via domain operations (e.g., register/approve flows) so tests survive domain evolution.
- Controlled time: Use a
TestClock to deterministically test time-based behavior like expiration and scheduling.
- SystemTestContext dependency injection: Inject a central test context with fakes for repositories and clients to keep test wiring simple and repeatable.
Real-world use cases include writing stable TDD-style test scaffolding for service workflows, verifying end-to-end-ish outcomes across domain operations with in-memory fakes, and testing time-dependent rules without waiting in real time.
Quick Start
Ask Claude to help you write a Kotlin test using SystemTestContext with fakes, create domain input with valid() Object Mothers, control time with TestClock if needed, and verify outcomes via domain operations (TTTD) instead of repository state setup.