[xwiki/xwiki-commons] d31f71: [Misc] Fix StringReaderMatcher on Java 25
Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-commons Commit: d31f71c30180966d708a3bd5e5ee6458bdc3d40e https://github.com/xwiki/xwiki-commons/commit/d31f71c30180966d708a3bd5e5ee64... Author: Marius Dumitru Florea <marius@xwiki.com> Date: 2026-08-27 (Thu, 27 Aug 2026) Changed paths: M xwiki-commons-tools/xwiki-commons-tool-test/xwiki-commons-tool-test-simple/pom.xml M xwiki-commons-tools/xwiki-commons-tool-test/xwiki-commons-tool-test-simple/src/main/java/org/xwiki/test/mockito/StringReaderMatcher.java A xwiki-commons-tools/xwiki-commons-tool-test/xwiki-commons-tool-test-simple/src/test/java/org/xwiki/test/mockito/StringReaderMatcherTest.java Log Message: ----------- [Misc] Fix StringReaderMatcher on Java 25 * java.io.StringReader has no "str" field anymore on Java 25, so the reflection based matcher was silently never matching, making tests relying on it fail with an empty result instead of the mocked one (TemplateManagerTest and RenderingScriptServiceTest in xwiki-platform) * Compare the content read from the reader instead, restoring its position with mark()/reset() so that the code under test can still consume it and the matcher can be called several times * Throw an UncheckedIOException instead of not matching when the reader cannot be read, since that can only happen when it's closed, which means the test itself is wrong * Add unit tests for the matcher and raise the module coverage ratio accordingly Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-commons/settings/notifications
participants (1)
-
XWiki Notifications