From 24ca5c86c0be96c06322f8276a0cbdbba8962c78 Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Wed, 1 Apr 2026 14:12:31 -0400 Subject: [PATCH] Fix UnnecessarySpringExtensionTest classpath version mismatch The test used unversioned classpath entries for spring-boot-test and spring-boot-test-autoconfigure, which could resolve to mismatched versions (e.g. 2.x test with 3.4.x autoconfigure). Pin both to 2.x since this is a Spring Boot 2 recipe. --- .../java/spring/boot2/UnnecessarySpringExtensionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/openrewrite/java/spring/boot2/UnnecessarySpringExtensionTest.java b/src/test/java/org/openrewrite/java/spring/boot2/UnnecessarySpringExtensionTest.java index 63cb71b9e..4cc3ef730 100644 --- a/src/test/java/org/openrewrite/java/spring/boot2/UnnecessarySpringExtensionTest.java +++ b/src/test/java/org/openrewrite/java/spring/boot2/UnnecessarySpringExtensionTest.java @@ -36,7 +36,7 @@ class UnnecessarySpringExtensionTest implements RewriteTest { public void defaults(RecipeSpec spec) { spec.recipe(new UnnecessarySpringExtension()) .parser(JavaParser.fromJavaVersion() - .classpathFromResources(new InMemoryExecutionContext(), "spring-context-5", "spring-test", "spring-boot-test", "junit-jupiter-api", "spring-boot-test-autoconfigure", "spring-batch-test")); + .classpathFromResources(new InMemoryExecutionContext(), "spring-context-5", "spring-test", "spring-boot-test-2.*", "junit-jupiter-api", "spring-boot-test-autoconfigure-2.*", "spring-batch-test")); } @DocumentExample