DEV-326: migrate Posix tests from JUnit 4 to JUnit 5#88
Open
Conversation
Keep Vintage on the classpath so existing JUnit 4 tests continue to run while source is migrated to Jupiter. Versions come from the parent java-parent-pom.
Mechanical migration via OpenRewrite's JUnit4to5Migration recipe: - org.junit.Test -> org.junit.jupiter.api.Test - org.junit.Assert.* -> org.junit.jupiter.api.Assertions.* - org.junit.Assume.* -> org.junit.jupiter.api.Assumptions.* - assumeTrue/assumeFalse(msg, bool) -> (bool, msg) Touches JNRPosixAPITest.java plus two BenchmarkMain helper classes that had assertEquals imports. All 12 tests still pass; no behavioural changes. Dropping junit-vintage-engine now that no JUnit 4 source remains.
5 tasks
peter-lawrey
approved these changes
Apr 29, 2026
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.
Summary
src/test/javato JUnit 5 Jupiter.junit:junitforjunit-jupiter(versions inherited fromjava-parent-pom).Bulk-change context
Part of a coordinated cross-repo JUnit 4 → JUnit 5 migration tracked by Epic DEV-324.
Sibling PRs (in this batch):
Acceptance criteria
mvn clean installpasses locallyJaCoCo is not configured in this repo, so the coverage gate is N/A.
What changed mechanically
org.junit.Test→org.junit.jupiter.api.Testorg.junit.Assert.*→org.junit.jupiter.api.Assertions.*org.junit.Assume.assumeTrue/assumeFalse→org.junit.jupiter.api.Assumptions.*assumeTrue/assumeFalse(msg, bool)→(bool, msg)(JUnit 5 message-last convention)Three test-tree files touched:
JNRPosixAPITest(the actual tests) plusBenchmarkMain/MSyncFileBenchmarkMain— non-test helpermain()classes that use JUnit assertions and needed consistent import changes.No production source changed.
Jira
DEV-326 — part of Epic DEV-324.
Fixes DEV-326.
🤖 Generated with Claude Code
CI note: ARM build red (pre-existing, out of scope)
The
Snapshot Linux ARMconfiguration fails because ofJNRPosixAPITest.mlock2— the ARM kernel on the TeamCity agent returnsENOSYSfor themlock2syscall, and the test has noassumeTrueguard for kernel-feature availability.Evidence this is not caused by this PR:
JNRPosixAPITest.mlock2, lines ~130-150) is byte-identical betweenorigin/developand this branch.sausage/docs-*doc-only branches (1 day prior) fail in the same ~11 seconds with the same error.Suggested follow-up (separate ticket): add
assumeTrue(jnr.has_mlock2())or equivalent kernel-capability guard toJNRPosixAPITest.mlock2.