From 251f882a3649571acd52b872038d0474d371fd79 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Fri, 13 Sep 2024 16:25:01 +0200 Subject: [PATCH] Include `ReplacePowerMockito` with `Mockito1to3Migration` again (#602) * Include `ReplacePowerMockito` with `Mockito1to3Migration` again * Drop `Mockito1to5Migration` from `ReplacePowerMockito` * Update description for ReplacePowerMockito * Look across all resource files for recipes --- src/main/resources/META-INF/rewrite/mockito.yml | 3 +-- src/main/resources/META-INF/rewrite/powermockito.yml | 3 +-- .../java/testing/mockito/RemoveMockitoSettingsTest.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/resources/META-INF/rewrite/mockito.yml b/src/main/resources/META-INF/rewrite/mockito.yml index 49a5b193a..fd6028729 100644 --- a/src/main/resources/META-INF/rewrite/mockito.yml +++ b/src/main/resources/META-INF/rewrite/mockito.yml @@ -151,8 +151,7 @@ recipeList: - org.openrewrite.java.testing.mockito.CleanupMockitoImports - org.openrewrite.java.testing.mockito.MockUtilsToStatic - org.openrewrite.java.testing.junit5.MockitoJUnitToMockitoExtension - # https://github.com/openrewrite/rewrite-testing-frameworks/issues/360 - # - org.openrewrite.java.testing.mockito.ReplacePowerMockito + - org.openrewrite.java.testing.mockito.ReplacePowerMockito - org.openrewrite.java.testing.mockito.RetainStrictnessWarn - org.openrewrite.java.dependencies.AddDependency: groupId: org.mockito diff --git a/src/main/resources/META-INF/rewrite/powermockito.yml b/src/main/resources/META-INF/rewrite/powermockito.yml index 79aa8d35f..c27c80d7e 100644 --- a/src/main/resources/META-INF/rewrite/powermockito.yml +++ b/src/main/resources/META-INF/rewrite/powermockito.yml @@ -18,12 +18,11 @@ type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.testing.mockito.ReplacePowerMockito displayName: Replace PowerMock with raw Mockito -description: Upgrade to Mockito 5 and replace PowerMockito with raw Mockito. +description: PowerMockito with raw Mockito; best executed as part of a Mockito upgrade. tags: - testing - mockito recipeList: - - org.openrewrite.java.testing.mockito.Mockito1to5Migration - org.openrewrite.java.RemoveAnnotation: annotationPattern: "@org.powermock.core.classloader.annotations.PowerMockIgnore" - org.openrewrite.java.ChangeMethodTargetToStatic: diff --git a/src/test/java/org/openrewrite/java/testing/mockito/RemoveMockitoSettingsTest.java b/src/test/java/org/openrewrite/java/testing/mockito/RemoveMockitoSettingsTest.java index 92a177991..b0f3cbe98 100644 --- a/src/test/java/org/openrewrite/java/testing/mockito/RemoveMockitoSettingsTest.java +++ b/src/test/java/org/openrewrite/java/testing/mockito/RemoveMockitoSettingsTest.java @@ -32,7 +32,7 @@ public void defaults(RecipeSpec spec) { .parser(JavaParser.fromJavaVersion() .classpathFromResources(new InMemoryExecutionContext(), "mockito-core", "mockito-junit-jupiter", "junit-jupiter-api")) - .recipeFromResource("/META-INF/rewrite/mockito.yml", "org.openrewrite.java.testing.mockito.MockitoBestPractices"); + .recipeFromResources("org.openrewrite.java.testing.mockito.MockitoBestPractices"); } @Test