Skip to content

Conversation

@bog-walk
Copy link
Member

@bog-walk bog-walk commented Nov 25, 2025

Description

Summary of the change:

  1. Migrate from org.junit.* (JUnit 4) to at minimum org.junit.jupiter.* (JUnit 5)
  2. Bump to JUnit 6 in all modules that already have JDK 17 as minimum requirement (Spring modules + Encryption module)

Detailed description:

  • Why: Predominantly to align with new minimum requirements for upcoming Spring Framework 7 bump.

  • How:

    • Introduce both JUnit 5 & Junit 6 dependencies.
    • All test suites, including exposed-tests and exposed-r2dbc-tests now depend on JUnit 5.
      • Replace all usages of org.junit.Test with org.junit.jupiter.api.Test
      • Replace @Before & @After with @BeforeEach & @AfterEach
      • Replace all usages of Assume & Assert with Assumptions & Assertions
      • Migrate from TemporaryFolder() rule to @TempDir
      • Migrate to use parameterized classes via @ParameterizedClass
      • Replace @Test(expected = …​) with Assert.assertThrows
      • Replace @Test(timeout = ...) with @Timeout
      • Migrate from custom rule for repeated test to new @RepeatedTest
      • Migrate away from CoroutinesTimeout() rule (different workarounds depending on case)
      • Replace Spring @RunWith(SpringJUnit4ClassRunner::class) with @ExtendWith(SpringExtension::class)
      • Replace Spring @FixMethodOrder with @TestMethodOrder
    • spring-transaction, exposed-spring-boot-starter, & exposed-crypt now depend on JUnit 6.

Type of Change

Please mark the relevant options with an "X":

  • Other - Dependency (Test) bump

Affected databases:

  • All

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs

Related Issues

EXPOSED-946
EXPOSED-941

@bog-walk bog-walk requested a review from e5l November 25, 2025 07:59
@bog-walk
Copy link
Member Author

@e5l This PR might not be fully ready 🤔

I'm trying to understand this successful build that is showing a significant drop in test amount, but took almost 20 minutes longer overall.
In IDEA test output, JUnit 5 does group tests from a single class in a drop down, so I'm trying to confirm that's what's happening here on TC too. When I go through the build log, it does seem like all tests are being run...

But it's so slow, I'm wondering if there's an extra setup step I've missed.

@bog-walk bog-walk force-pushed the bog-walk/bump-junit-version branch from a07c3e7 to b952ca7 Compare November 26, 2025 03:34
@bog-walk
Copy link
Member Author

I added the platform launcher to check but the successful build is consistent. The only place I haven't looked is in TC config itself, to see if it has some setting for how tests are being counted/reported, or if there's some way to ungroup them.

I'm looking into the failing Detekt btw. Passes locally & message is unhelpful, so I have to pass through to confirm.

@e5l
Copy link
Member

e5l commented Nov 26, 2025

image It shows 15 runs for test, I guess it means multiple runs for the different platforms

Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

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

lgtm

@bog-walk bog-walk force-pushed the bog-walk/bump-junit-version branch from b952ca7 to 61e57c2 Compare November 28, 2025 01:08
@bog-walk bog-walk merged commit d382dab into main Nov 28, 2025
5 of 7 checks passed
@bog-walk bog-walk deleted the bog-walk/bump-junit-version branch November 28, 2025 04:04
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.

3 participants