Skip to content

Commit 184a076

Browse files
committed
Rename Mockito3to4MigrationAdd to Mockito1to4Migration since the recipe already referenced the 1To3Migration. Also added an Upgrade Maven Dependency to for mockito 4.x and updated the Junit UseMockitoExtension recipe to reference the Mockito1To4Migration. (closes #186)
1 parent be149bb commit 184a076

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/main/resources/META-INF/rewrite/junit5.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ tags:
131131
- junit
132132
- mockito
133133
recipeList:
134-
- org.openrewrite.java.testing.mockito.Mockito1to3Migration
134+
- org.openrewrite.java.testing.mockito.Mockito1to4Migration
135135
- org.openrewrite.java.testing.mockito.MockitoJUnitRunnerSilentToExtension
136136
- org.openrewrite.java.testing.junit5.RunnerToExtension:
137137
runners:

src/main/resources/META-INF/rewrite/mockito.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@
1515
#
1616
---
1717
type: specs.openrewrite.org/v1beta/recipe
18-
name: org.openrewrite.java.testing.mockito.Mockito3to4Migration
19-
displayName: Mockito 4.x migration from 3.x
20-
description: Upgrade Mockito from 3.x to 4.x.
18+
name: org.openrewrite.java.testing.mockito.Mockito1to4Migration
19+
displayName: Mockito 4.x upgrade
20+
description: Upgrade Mockito from 1.x to 4.x.
2121
tags:
2222
- testing
2323
- mockito
2424
recipeList:
2525
- org.openrewrite.java.testing.mockito.Mockito1to3Migration
26+
- org.openrewrite.maven.UpgradeDependency:
27+
groupId: org.mockito
28+
artifactId: mockito-junit-jupiter
29+
version: 4.x
2630
---
2731
type: specs.openrewrite.org/v1beta/recipe
2832
name: org.openrewrite.java.testing.mockito.Mockito1to3Migration

src/test/kotlin/org/openrewrite/java/testing/mockito/JunitMockitoUpgradeIntegrationTest.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import org.openrewrite.java.JavaRecipeTest
2424
/**
2525
* Validates the recipes related to upgrading from Mockito 1 to Mockito 3
2626
*/
27-
@Suppress("unchecked")
27+
@Suppress("unchecked", "NotNullFieldNotInitialized", "NewClassNamingConvention")
2828
class JunitMockitoUpgradeIntegrationTest : JavaRecipeTest {
2929
override val parser: JavaParser = JavaParser.fromJavaVersion()
3030
.classpath("mockito-all", "junit", "hamcrest")
@@ -34,8 +34,7 @@ class JunitMockitoUpgradeIntegrationTest : JavaRecipeTest {
3434
.scanRuntimeClasspath("org.openrewrite.java.testing.junit5")
3535
.build()
3636
.activateRecipes(
37-
"org.openrewrite.java.testing.junit5.JUnit4to5Migration",
38-
"org.openrewrite.java.testing.mockito.Mockito1to3Migration"
37+
"org.openrewrite.java.testing.junit5.JUnit4to5Migration"
3938
)
4039

4140
/**

0 commit comments

Comments
 (0)