Skip to content

Migrate tests to JUnit 5 #10349

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

vlsi
Copy link

@vlsi vlsi commented Jun 3, 2025

This PR refactors the existing tests to JUnit 5.

Fixes #970
This is an alternative to #10285

The major migration was made with IDEA's "migrate JUnit 4 to 5", then I replaced @RunWith(Parameterized.class) with @ParameterizedClass.

There are still some leftovers:

  • for unknown reasons, JUnit 5 forces @Nested classes to be non-static: Can @Nested class be non-static? junit-team/junit5#4613
  • some of the classes still use @Rule public MockTestcontainersConfigurationRule
  • there is one @RunWith(MockitoJUnitRunner.class)
  • there are two @RunWith(BlockJUnit4ClassRunner.class)
  • there is one @RunWith(Suite.class)
  • there is one @RunWith(Enclosed.class)
  • there is on @RunWith(Cucumber.class)
  • the documentation still refers to junit4 patterns

@vlsi vlsi force-pushed the junit5_migrate branch 4 times, most recently from 6574921 to beb7963 Compare June 3, 2025 17:05
@vlsi vlsi force-pushed the junit5_migrate branch from beb7963 to 0ef58b5 Compare June 4, 2025 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment