From ef62c319fd5b4b77b030fcb409b11402debdf121 Mon Sep 17 00:00:00 2001 From: Sam Snyder Date: Tue, 12 Nov 2024 14:09:53 -0800 Subject: [PATCH] Create a mockito upgrade recipe that just does 4 -> 5, so it can be included in Spring 3.1 upgrade. Both "Migrate to Spring Boot 2.4" and "Mockito 5.x upgrade" include "Mockito 4.x upgrade" So if we add "Mockito 5.x upgrade" into "Migrate to Spring Boot 3.1" then "Mockito 4.x upgrade", and all its constituent recipes, will be run twice. The performance cost of this is not dire, but the spring boot migration is already a very large recipe with ~2k steps. --- src/main/resources/META-INF/rewrite/mockito.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/resources/META-INF/rewrite/mockito.yml b/src/main/resources/META-INF/rewrite/mockito.yml index dc569f5e0..e75ef742d 100644 --- a/src/main/resources/META-INF/rewrite/mockito.yml +++ b/src/main/resources/META-INF/rewrite/mockito.yml @@ -31,6 +31,17 @@ type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.testing.mockito.Mockito1to5Migration displayName: Mockito 5.x upgrade description: Upgrade Mockito from 1.x to 5.x. +tags: + - testing + - mockito +recipeList: + - org.openrewrite.java.testing.mockito.Mockito1to4Migration + - org.openrewrite.java.testing.mockito.Mockito4to5Only +--- +type: specs.openrewrite.org/v1beta/recipe +name: org.openrewrite.java.testing.mockito.Mockito4to5Only +displayName: Mockito 4 to 5.x upgrade only +description: Upgrade Mockito from 4.x to 5.x. Does not include 1.x to 4.x migration. tags: - testing - mockito @@ -49,7 +60,6 @@ recipeList: artifactId: byte-buddy* newVersion: 1.15.x - org.openrewrite.maven.RemoveDuplicateDependencies - --- type: specs.openrewrite.org/v1beta/recipe name: org.openrewrite.java.testing.mockito.Mockito1to4Migration