Testing in this project is designed to catch regressions early while keeping contributor workflow practical.
Tests are organized under src/test/java and mirror production package boundaries:
- API tests for public contracts and utility behavior
- framework tests for lifecycle, config, command, and loader logic
- feature tests for feature-specific logic and edge cases
Shared helpers live under src/test/java/nl/hauntedmc/serverfeatures/util.
Run tests:
mvn -q testRun the full quality gate:
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 near that behavior:
- feature changes: user-visible logic, edge cases, fallback behavior
- framework changes: lifecycle and dependency-resolution contracts
- API changes: conversion, fallback, error handling, and stability guarantees
Focus on regression-prone logic paths (branching rules, validation, parsing, state transitions).
Use these rules during authoring and review:
- prefer behavior assertions over "does not throw" smoke checks;
- avoid tests that only mirror declaration state (pure enum/constant checks);
- avoid pure getter/setter round-trip tests unless they protect a real invariant;
- assert observable outcomes for both happy and failure paths.
Use this when doing a full feature/class/method scan:
- Run
mvn -q test jacoco:report. - Review
target/site/jacoco/index.htmland sort by missed lines/branches. - Use
target/site/jacoco/jacoco.csvto find high-risk classes with high missed lines and branches. - Add tests for behavior-heavy methods first.
Prioritize methods with both high line miss and high branch count.
CI runs:
- Checkstyle (
ci-lint.yml) - Tests and coverage (
ci-tests-and-coverage.yml)
Tag pushes (v*) trigger release packaging and publication (release-package.yml).