Skip to content

DEV-325: migrate Chronicle-Values tests from JUnit 4 to JUnit 5#176

Open
tgd wants to merge 2 commits intodevelopfrom
feature/DEV-325-junit-4-to-5
Open

DEV-325: migrate Chronicle-Values tests from JUnit 4 to JUnit 5#176
tgd wants to merge 2 commits intodevelopfrom
feature/DEV-325-junit-4-to-5

Conversation

@tgd
Copy link
Copy Markdown
Contributor

@tgd tgd commented Apr 19, 2026

Summary

  • Mechanical migration of all 12 test classes from JUnit 4 (org.junit) to JUnit 5 Jupiter (org.junit.jupiter.api).
  • POM change: swap junit:junit for junit-jupiter (versions inherited from java-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 install passes locally (includes license:check and maven-bundle packaging)
  • Test count preserved vs. baseline (47 → 47 across 11 classes)
  • Diff limited to JUnit migration edits (no drive-by reformatting)
  • Latency-aware code review passes 1 & 2 clean (test code only, no production changes)
  • CI green

JaCoCo is not configured in this repo, so the coverage gate is N/A.

What changed mechanically

  • org.junit.Testorg.junit.jupiter.api.Test
  • org.junit.Assert.*org.junit.jupiter.api.Assertions.*
  • @Before / @After@BeforeEach / @AfterEach
  • Messaged assertions re-ordered so the message is the last argument (JUnit 5 convention). All re-orderings verified by human review — no double-reversals.

No production source changed.

Jira

DEV-325 — part of Epic DEV-324.

Fixes DEV-325.

🤖 Generated with Claude Code

tgd added 2 commits April 19, 2026 20:31
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 (jupiter 5.10.0).
Mechanical migration of all 12 test classes from JUnit 4 to JUnit 5
(org.junit.jupiter.api) via OpenRewrite's JUnit4to5Migration recipe:

- org.junit.Test -> org.junit.jupiter.api.Test
- org.junit.Assert.* -> org.junit.jupiter.api.Assertions.*
- @Before/@after -> @BeforeEach/@AfterEach
- assertX(msg, expected, actual) -> assertX(expected, actual, msg)

All 47 tests still pass; no behavioural changes. Dropping
junit-vintage-engine now that no JUnit 4 source remains.
@sonarqubecloud
Copy link
Copy Markdown

} catch (AssertionError e) {
e.printStackTrace();
assertFalse("Throws an IllegalArgumentException", true);
assertFalse(true, "Throws an IllegalArgumentException");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it shouldn't catch the AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants