diff --git a/src/test/java/org/openrewrite/java/dependencies/search/FindMinimumDependencyVersionTest.java b/src/test/java/org/openrewrite/java/dependencies/search/FindMinimumDependencyVersionTest.java index 9b9cf61..ee06fe4 100644 --- a/src/test/java/org/openrewrite/java/dependencies/search/FindMinimumDependencyVersionTest.java +++ b/src/test/java/org/openrewrite/java/dependencies/search/FindMinimumDependencyVersionTest.java @@ -16,6 +16,7 @@ package org.openrewrite.java.dependencies.search; import org.junit.jupiter.api.Test; +import org.openrewrite.DocumentExample; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; @@ -31,6 +32,7 @@ public void defaults(RecipeSpec spec) { spec.recipe(new FindMinimumDependencyVersion("com.fasterxml.jackson*", "jackson-core", "2.14-2.16")); } + @DocumentExample @Test void minimumMaven() { rewriteRun( @@ -163,4 +165,66 @@ void noMatchBecauseVersionIsOutsideRange() { ) ); } + + @Test + void findMultiple() { + rewriteRun( + //language=yaml + spec -> spec.recipeFromYaml(""" + type: specs.openrewrite.org/v1beta/recipe + name: org.openrewrite.MyRecipe + description: composite recipe finding 2 versions. + recipeList: + - org.openrewrite.java.dependencies.search.FindMinimumDependencyVersion: + groupIdPattern: com.fasterxml.jackson.core + artifactIdPattern: jackson-core + version: 2.14-2.16 + - org.openrewrite.java.dependencies.search.FindMinimumDependencyVersion: + groupIdPattern: commons-lang + artifactIdPattern: commons-lang + version: 2.5-2.7 + """, "org.openrewrite.MyRecipe"), + //language=xml + pomXml( + """ + + org.openrewrite + core + 0.1.0-SNAPSHOT + + + com.fasterxml.jackson.core + jackson-core + 2.15.0 + + + commons-lang + commons-lang + 2.6 + + + + """, + """ + + org.openrewrite + core + 0.1.0-SNAPSHOT + + + com.fasterxml.jackson.core + jackson-core + 2.15.0 + + + commons-lang + commons-lang + 2.6 + + + + """ + ) + ); + } }