Java
Java copied to clipboard
Add test coverage improvements, Maven dev profile, and ConsoleInterceptor
- [x] I have read CONTRIBUTING.md.
- [x] This pull request is all my own work -- I have not plagiarized it.
- [x] All filenames are in PascalCase.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
- [x] All new code is formatted with
clang-format -i --style=file path/to/your/file.java
This PR is part of a test course project and includes the following improvements:
- Expanded test coverage for the most under-tested packages, improving overall code reliability.
- Optional Maven dev profile added to allow developers to easily switch between classes and generate reports for PIT mutation testing.
- ConsoleInterceptor implementation to simplify testing of classes that heavily rely on console input/output. (not thread-safe)
- Minor refactors to improve testability without changing core logic
Notes:
- Focus on ConsoleInterceptor usage and test coverage improvements.
- For a thread-safe version of the interceptor, it might be beneficial to consider enforcing scanners and console output via constructor injection to allow mocking of streams.