Situation
The project currently uses a custom `OsDetector` utility (and an underlying `OsCheck` class) located in the `testutil` module to handle OS-specific test execution. This is typically done using methods like `OsDetector.assumeRunningOnWindows()` or `OsDetector.assumeRunningOnUnix()` inside test methods.
JUnit 5 provides a standard way to handle this via the `@EnabledOnOs` and `@DisabledOnOs` annotations. Using these standard annotations improves code readability, follows JUnit best practices, and allows for removing custom infrastructure code.
Implementation Hints
- Refactor Tests:
- Replace calls to `OsDetector.assumeRunningOnWindows()` with `@EnabledOnOs(OS.WINDOWS)` at the method or class level.
- Replace calls to `OsDetector.assumeRunningOnUnix()` with `@EnabledOnOs({OS.LINUX, OS.MAC})` or similar, depending on the test requirements.
- Update tests in:
- `core/src/test/java/org/itsallcode/openfasttrace/core/importer/TestImporterService.java`
- `core/src/test/java/org/itsallcode/openfasttrace/core/importer/tag/config/DescribedPathMatcherTest.java`
- `reporter/html/src/test/java/org/itsallcode/openfasttrace/report/html/view/html/TestOriginLinkFormatter.java`
- `product/src/test/java/org/itsallcode/openfasttrace/report/html/TestHtmlReportCssInlining.java`
- Remove Utility Classes:
- Once all references are removed, delete `org.itsallcode.openfasttrace.testutil.OsDetector` and `org.itsallcode.openfasttrace.testutil.OsCheck`.
- Check for any other usages of `OsCheck` in production code.
- Update Dependencies:
- Ensure `junit-jupiter-api` is available (it is already used across the project).
Acceptance Criteria
- `OsDetector` and `OsCheck` classes are removed from the codebase.
- All tests that previously used `OsDetector` now use `@EnabledOnOs` or other JUnit 5 execution conditions.
- The build passes on all target operating systems (Windows, Linux, macOS) in CI.
- `mvn verify` completes successfully.
Situation
The project currently uses a custom `OsDetector` utility (and an underlying `OsCheck` class) located in the `testutil` module to handle OS-specific test execution. This is typically done using methods like `OsDetector.assumeRunningOnWindows()` or `OsDetector.assumeRunningOnUnix()` inside test methods.
JUnit 5 provides a standard way to handle this via the `@EnabledOnOs` and `@DisabledOnOs` annotations. Using these standard annotations improves code readability, follows JUnit best practices, and allows for removing custom infrastructure code.
Implementation Hints
Acceptance Criteria