class SampleJUnit4Test { public static class RelationalTest1 { @Test public void test() { ... } } public static class RelationalTest2 { @Test public void test() { ... } } } public class SampleJUnit5Test { @Nested class RelationalTest1 { @Test public void test() { ... } } @Nested class RelationalTest2 { @Test public void test() { ... } } } JUnit 4 JUnit 5
Just make sure that the junit-vintage-engine artifact is in your test runtime path. In that case JUnit 3 and JUnit 4 tests will automatically be picked up by the JUnit Platform launcher. 公式ガイドラインを調べてみると、以下の記載を発見する。 https://junit.org/junit5/docs/current/user-guide/#migrating-from-junit4 junit-vintage-engine を使うことで JUnit 4 を維持しながら、 マイグレーションすることが可能ということが分かりました。