Testing in this project is designed to catch regressions early while keeping contributor workflow practical.
Tests are organized under src/test/java and generally mirror production package boundaries:
- API tests for public-facing contracts
- framework tests for core lifecycle/config/loading behavior
- feature tests for feature-specific logic and edge cases
Shared test resources live under src/test/resources.
Run tests:
mvn -q testRun the full quality gate (tests + coverage checks):
mvn -B verifyRun lint checks:
mvn -B -DskipTests checkstyle:checkGenerate a local coverage report:
mvn -q test jacoco:reportWhen you change behavior, add or update tests close to that behavior:
- feature changes: validate feature logic and expected edge cases
- framework changes: validate lifecycle/config/loader contracts
- API changes: validate conversion, fallback, and error-handling behavior
Focus on user-visible behavior and regression-prone logic. Avoid writing tests that only duplicate framework boilerplate.
Use these rules when adding or reviewing tests:
- prefer behavior assertions over "does not throw" assertions;
- avoid getter/setter/record-equality-only tests unless they protect non-trivial invariants;
- avoid static mocking when normal dependency injection or instance mocks are possible;
- assert observable outcomes (state, return values, emitted messages, interactions) for both happy and failure paths.
Coverage gates are enforced in CI for core areas and selected feature logic. The exact target set can evolve over time, so treat coverage as a quality signal, not a box-checking exercise.
If mvn verify fails on coverage:
- confirm the new behavior has tests;
- cover failure/edge paths, not only happy paths;
- rerun locally before opening a PR.
- IntelliJ: run tests with coverage and inspect the Coverage tool window.
- HTML report:
target/site/jacoco/index.htmlaftermvn verify. - CSV summary:
target/site/jacoco/jacoco.csvaftermvn -q test jacoco:report.
Use this when you want a full feature/class/method scan, not just per-change verification:
- Run
mvn -q test jacoco:report. - Review
target/site/jacoco/index.htmland sort by missed lines/branches. - Use
target/site/jacoco/jacoco.csvto quickly spot high-risk classes with highLINE_MISSEDandBRANCH_MISSED. - Drill into those classes in the HTML report and add tests for behavior-heavy methods first (commands, services, listeners).
Prioritize methods with both high line_missed and high branch_total; these are typically the highest regression-risk paths.
CI validates tests, coverage, and linting on pull requests and main branch updates.