mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-01 01:21:18 +01:00
# Description of Changes This pull request primarily refactors and improves the test code across several modules, focusing on modernization, simplification, and consistency of assertions and test setup. The changes include formatting updates and improvements to utility methods. These updates help make the tests easier to maintain and read, and ensure they use current best practices. **Test code modernization and assertion improvements:** * Replaced legacy assertion methods such as `assertTrue(x instanceof Y)` with more specific `assertInstanceOf` assertions in multiple test files, improving clarity and type safety. * Updated exception assertion checks to use `assertInstanceOf` for error types instead of `assertTrue`, ensuring more precise test validation. * Refactored test setup in `ResourceMonitorTest` to use `final` for `AtomicReference` fields, clarifying intent and thread safety. * Changed some test method signatures to remove unnecessary `throws Exception` clauses, simplifying the test code. **Test code simplification and cleanup:** * Removed unused mock fields and simplified array initializations in `AutoJobPostMappingIntegrationTest`, streamlining test setup and reducing clutter. * Updated YAML string initialization in `ApplicationPropertiesDynamicYamlPropertySourceTest` to use Java text blocks for improved readability. * Improved null handling in assertions for collection validity checks. * Updated byte array encoding to use `StandardCharsets.UTF_8` for reliability and clarity. **PDF document factory test refactoring:** * Refactored `CustomPDFDocumentFactoryTest` to move helper methods for inflating PDFs and writing temp files to the top of the class, and restructured parameterized tests for better organization and maintainability. <!-- Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --> --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md) (if applicable) - [ ] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md) (if applicable) - [ ] I have performed a self-review of my own code - [ ] My changes generate no new warnings ### Documentation - [ ] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [ ] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [ ] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [ ] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing) for more details. --------- Signed-off-by: Balázs Szücs <bszucs1209@gmail.com> |
||
|---|---|---|
| .. | ||
| src | ||
| .gitignore | ||
| build.gradle | ||
| LICENSE | ||