File tree Expand file tree Collapse file tree 4 files changed +20
-4
lines changed
java/org/openrewrite/java/testing/junit5
resources/META-INF/rewrite
test/kotlin/org/openrewrite/java/testing Expand file tree Collapse file tree 4 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 2626 * Orders imports and removes unused imports from classes which import symbols from the "org.junit" package.
2727 */
2828public class CleanupJUnitImports extends Recipe {
29-
3029 @ Override
3130 protected TreeVisitor <?, ExecutionContext > getVisitor () {
3231 return new CleanupJUnitImportsVisitor ();
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ recipeList:
2929 - org.openrewrite.maven.ExcludeDependency :
3030 groupId : org.junit.vintage
3131 artifactId : junit-vintage-engine
32+ - org.openrewrite.maven.ExcludeDependency :
33+ groupId : junit
34+ artifactId : junit
3235 - org.openrewrite.java.testing.junit5.AssertToAssertions
3336 - org.openrewrite.java.testing.junit5.CategoryToTag
3437 - org.openrewrite.java.testing.junit5.CleanupJUnitImports
Original file line number Diff line number Diff line change 1616package org.openrewrite.java.testing.junit5
1717
1818import org.junit.jupiter.api.Test
19- import org.openrewrite.Recipe
2019import org.openrewrite.java.JavaRecipeTest
2120import org.openrewrite.java.JavaParser
2221
@@ -25,8 +24,7 @@ class CleanupJUnitImportsTest : JavaRecipeTest {
2524 .classpath(" junit" )
2625 .build()
2726
28- override val recipe: Recipe
29- get() = CleanupJUnitImports ()
27+ override val recipe = CleanupJUnitImports ()
3028
3129 @Test
3230 fun removesUnusedImport () = assertChanged(
Original file line number Diff line number Diff line change @@ -476,6 +476,11 @@ class JunitMockitoUpgradeIntegrationTest : JavaRecipeTest {
476476 <version>4.12</version>
477477 <scope>test</scope>
478478 </dependency>
479+ <dependency>
480+ <groupId>com.googlecode.json-simple</groupId>
481+ <artifactId>json-simple</artifactId>
482+ <version>1.1.1</version>
483+ </dependency>
479484 </dependencies>
480485 </project>
481486 """ .trimIndent())[0 ]
@@ -513,6 +518,17 @@ class JunitMockitoUpgradeIntegrationTest : JavaRecipeTest {
513518 <version>5.7.1</version>
514519 <scope>test</scope>
515520 </dependency>
521+ <dependency>
522+ <groupId>com.googlecode.json-simple</groupId>
523+ <artifactId>json-simple</artifactId>
524+ <version>1.1.1</version>
525+ <exclusions>
526+ <exclusion>
527+ <groupId>junit</groupId>
528+ <artifactId>junit</artifactId>
529+ </exclusion>
530+ </exclusions>
531+ </dependency>
516532 </dependencies>
517533 </project>
518534 """ .trimIndent())
You can’t perform that action at this time.
0 commit comments