Skip to content

MYFACES-4785: Upgrade tests to JUnit 6 - #1145

Merged
tandraschko merged 1 commit into
apache:mainfrom
melloware:MYFACES-4785-junit6
Nov 26, 2026
Merged

tandraschko merged 1 commit into
apache:mainfrom
melloware:MYFACES-4785-junit6

Conversation

@melloware

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/MYFACES-4785

Migrates the test suite to JUnit 6 (6.1.3) using OpenRewrite, bumps Surefire to 3.6.1, and fixes the breakage the automated migration introduced.

Fixes after OpenRewrite

  • UIDataTest restored to public (its RowData is used by UIRepeatTest in another package).
  • Subclass overrides updated to match renamed base test methods (StateManagerWithFaceletsClientSideTest, Html{Body,SelectManyCheckbox,SelectOneRadio}ClientBehaviorRendererTest).
  • assertDoesNotThrow lambdas that assigned captured locals now return values or use effectively-final copies (ViewHandlerImplTest, HtmlTableRendererTest, ResponseWrapperSwitchTest, AbstractClientBehaviorTestCase); the worker-thread blocks in LRULinkedHashMapTest go back to try/catch.
  • ResourceLoaderUtilsTest.parseDateHeader: restored the 2000 ms delta the rewrite dropped.
  • UIComponentBaseTest.processDecodesCallsRenderResoponseIfDecodeThrowsException: restored the original structure. Note: this test already passed without testing anything before this change (expectLastCall() throws IllegalStateException, which satisfies assertThrows). Worth a follow-up.
  • Quarkus showcase stays on JUnit 5.13.4: Quarkus 3.27.1 (quarkus-junit5) ships the JUnit 5 platform, and mixing in Jupiter 6 fails test discovery.

Testing

mvn install passes locally: impl 1787 tests, 0 failures. The Quarkus showcase passes too (1 test was already @Disabled).

🤖 Generated with Claude Code

Migrate tests to JUnit 6 via OpenRewrite and fix the resulting breakage:
- restore cross-package visibility and renamed overrides
- fix lambdas that assigned captured locals
- restore assertEquals delta in ResourceLoaderUtilsTest
- keep Quarkus showcase on JUnit 5.13.4 (Quarkus 3.27 does not support JUnit 6)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tandraschko
tandraschko merged commit 4ae9b7e into apache:main Nov 26, 2026
4 checks passed
@melloware
melloware deleted the MYFACES-4785-junit6 branch November 26, 2026 11:51
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