Move the core IT suite off the JUnit 4 assertions (4.0.x) - #12719
Merged
Conversation
Five classes in the suite still reached for org.junit.Assert while already being annotated with the Jupiter @test, so they were the last thing keeping JUnit 4 on the its classpath. They now use org.junit.jupiter.api.Assertions. Four of them only needed the static import swapped. The fifth, MavenITmng7772CoreExtensionFoundTest, passed a message to assertTrue: the message is the FIRST argument in JUnit 4 and the LAST in JUnit 5, so that call is reordered rather than merely re-imported. This is the 4.0.x counterpart of the same change on master. Generated-by: Claude Opus 5 (1M context)
slachiewicz
marked this pull request as ready for review
August 9, 2026 22:03
gnodet
approved these changes
Aug 9, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Clean and correct JUnit 4 to JUnit 5 assertion migration across 5 integration test files (4.0.x backport). The assertTrue argument reorder in MavenITmng7772CoreExtensionFoundTest is properly handled (JUnit 4 assertTrue(String, boolean) → JUnit 5 assertTrue(boolean, String)). The remaining 4 files are straightforward import swaps with no semantic changes. CI is green across all completed checks.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five classes in
its/core-it-suitewere already annotated with the Jupiter@Testbut still calledorg.junit.Assert, which is the only thing still pulling JUnit 4 onto the IT classpath. They now useorg.junit.jupiter.api.Assertions.Four needed nothing but the static import swapped. The fifth is the one worth a second look:
The message is the first argument in JUnit 4 and the last in JUnit 5. Left as a plain import swap it would still compile —
assertTrue(String, boolean)has no Jupiter overload, so that one actually fails to compile, but the equivalentassertEquals(message, expected, actual)form does not, and silently asserts the wrong thing. Worth watching for in similar cleanups.Verification — please read before merging
I could not run this suite. The
itsreactor needs the0.1-stub-SNAPSHOTplugin artifacts and2.1-SNAPSHOTit-support artifacts built first, and that build does not complete in my environment. What I did instead:javaccompile check of the changed files against a classpath assembled from the cachedmaven-it-helperjar plusjunit-jupiter-api/opentest4j/apiguardian, with no JUnit 4 jar present — cleanorg.junit.Assertreference remains anywhere inits/core-it-suite/src/test/javaitsreactor does not configure spotless, so there is no formatter to run)So this is compile-checked, not test-run. Given the change is import-level plus one argument reorder, CI should settle it — but I would rather say that plainly than imply I ran the ITs.
The same change is on the 4.0.x line as a separate PR.
Generated-by: Claude Opus 5 (1M context)