Repository navigation
Add missing @Test annotations to 4 tests JUnit 5 does not collect (2.x) - #6268
Conversation
The 2.x counterpart of FasterXML#6266, requested on that PR. `EmptyContentAsTreeTest` names its four methods `test...` but annotates none of them, and the class extends `DatabindTestUtil` rather than `TestCase`, so nothing collects them by name either. The class has been running zero tests. `mvn test` goes from 4868 to 4872. All four pass as written, so this adds coverage without changing behaviour. The 2.x surface is much smaller than 3.x: this one class is the only case on this branch, against 27 methods in 12 files on `3.x`. `Java21CollectionsTest` under `src/test-jdk21` has the same two uncollected methods on both branches and is excluded for the same reason as in FasterXML#6266, since annotating them fails with `IllegalAccessException` because the module does not export `com.fasterxml.jackson.databind.jdk21` to `org.junit.platform.commons`.
CI failed: 7 test errors occurred due to a Mockito initialization incompatibility with Java 21, unrelated to the PR's addition of missing JUnit 5 @test annotations.Overview1 test execution failure pattern was found across 1 analyzed log, resulting in 7 test errors due to Mockito initialization issues on Java 21. Overall assessment is that this is an environment/dependency compatibility issue unrelated to the changes in the PR. FailuresMockito Initialization Failure on Java 21 (confidence: high)
Summary
Code Review ✅ Approved🟢 Low risk · Adds JUnit discovery annotations to four existing tests without runtime changes. Adds missing Tip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
NOTE: test-only changes, ok without CLA. |
The 2.x counterpart of #6266, as @pjfanning asked for there.
EmptyContentAsTreeTestnames its four methodstest...and annotates none of them. The class extendsDatabindTestUtilrather thanTestCase, so nothing collects them by name either, and the class has been running zero tests while the build stayed green.mvn testgoes from 4868 to 4872. All four pass as written, so this adds coverage rather than changing behaviour.How much smaller 2.x is
One class, against 27 methods in 12 files on
3.x. Most of the3.xcases came in with that branch's own test migration, so they have no 2.x equivalent.Left out, same as on 3.x
src/test-jdk21/.../Java21CollectionsTesthas the same two uncollected methods on both branches. Annotating them fails withIllegalAccessException, because the module does not exportcom.fasterxml.jackson.databind.jdk21toorg.junit.platform.commons. That needs a module or surefire decision rather than an annotation.One thing worth knowing
ObjectWriterTest.testViewSettingsfails on clean2.xfor me, before any change:It fails identically with and without this change, so it is not from here, but you may want to know it is red locally.