From 235f3d42b3fe9b42ec3e36cdad3218520b4db7f0 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Thu, 19 Sep 2024 15:25:37 +0200 Subject: [PATCH] Demonstrate removal of explicit junit4 dependency --- .../testing/junit5/JUnit5MigrationTest.java | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java b/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java index 17478e64..b4dff855 100644 --- a/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java +++ b/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java @@ -416,4 +416,67 @@ void bumpSurefireOnOlderMavenVersions() { ) ); } + + @Test + void removeAndExcludeJUnit4Dependency() { + rewriteRun( + //language=xml + pomXml( + """ + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.5 + + + org.example + project + 0.0.1 + + 4.13.2 + + + + org.springframework.boot + spring-boot-starter-test + test + + + junit + junit + ${my-junit.version} + test + + + + """, + """ + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.5 + + + org.example + project + 0.0.1 + + 4.13.2 + + + + org.springframework.boot + spring-boot-starter-test + test + + + + """ + ) + ); + } }