Skip to content

Commit

Permalink
Rename Mockito3to4MigrationAdd to Mockito1to4Migration since the …
Browse files Browse the repository at this point in the history
…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)
  • Loading branch information
pway99 committed Aug 30, 2022
1 parent be149bb commit 184a076
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/rewrite/junit5.yml
Expand Up @@ -131,7 +131,7 @@ tags:
- junit
- mockito
recipeList:
- org.openrewrite.java.testing.mockito.Mockito1to3Migration
- org.openrewrite.java.testing.mockito.Mockito1to4Migration
- org.openrewrite.java.testing.mockito.MockitoJUnitRunnerSilentToExtension
- org.openrewrite.java.testing.junit5.RunnerToExtension:
runners:
Expand Down
10 changes: 7 additions & 3 deletions src/main/resources/META-INF/rewrite/mockito.yml
Expand Up @@ -15,14 +15,18 @@
#
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.testing.mockito.Mockito3to4Migration
displayName: Mockito 4.x migration from 3.x
description: Upgrade Mockito from 3.x to 4.x.
name: org.openrewrite.java.testing.mockito.Mockito1to4Migration
displayName: Mockito 4.x upgrade
description: Upgrade Mockito from 1.x to 4.x.
tags:
- testing
- mockito
recipeList:
- org.openrewrite.java.testing.mockito.Mockito1to3Migration
- org.openrewrite.maven.UpgradeDependency:
groupId: org.mockito
artifactId: mockito-junit-jupiter
version: 4.x
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.testing.mockito.Mockito1to3Migration
Expand Down
Expand Up @@ -24,7 +24,7 @@ import org.openrewrite.java.JavaRecipeTest
/**
* Validates the recipes related to upgrading from Mockito 1 to Mockito 3
*/
@Suppress("unchecked")
@Suppress("unchecked", "NotNullFieldNotInitialized", "NewClassNamingConvention")
class JunitMockitoUpgradeIntegrationTest : JavaRecipeTest {
override val parser: JavaParser = JavaParser.fromJavaVersion()
.classpath("mockito-all", "junit", "hamcrest")
Expand All @@ -34,8 +34,7 @@ class JunitMockitoUpgradeIntegrationTest : JavaRecipeTest {
.scanRuntimeClasspath("org.openrewrite.java.testing.junit5")
.build()
.activateRecipes(
"org.openrewrite.java.testing.junit5.JUnit4to5Migration",
"org.openrewrite.java.testing.mockito.Mockito1to3Migration"
"org.openrewrite.java.testing.junit5.JUnit4to5Migration"
)

/**
Expand Down

0 comments on commit 184a076

Please sign in to comment.