From b2960952f9b1cc74aca895c1c40b474408ed03aa Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 29 Jul 2024 17:14:59 +0200 Subject: [PATCH] Polish Spring Boot 3.3 SpringCloudVersionUpgradeTest --- .../boot3/SpringCloudVersionUpgradeTest.java | 51 +++---------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/src/testWithSpringBoot_3_3/java/org/openrewrite/java/spring/boot3/SpringCloudVersionUpgradeTest.java b/src/testWithSpringBoot_3_3/java/org/openrewrite/java/spring/boot3/SpringCloudVersionUpgradeTest.java index bdc8c4ad5..092cbff7d 100644 --- a/src/testWithSpringBoot_3_3/java/org/openrewrite/java/spring/boot3/SpringCloudVersionUpgradeTest.java +++ b/src/testWithSpringBoot_3_3/java/org/openrewrite/java/spring/boot3/SpringCloudVersionUpgradeTest.java @@ -16,11 +16,13 @@ package org.openrewrite.java.spring.boot3; import org.junit.jupiter.api.Test; +import org.openrewrite.DocumentExample; import org.openrewrite.config.Environment; import org.openrewrite.java.JavaParser; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.java.Assertions.mavenProject; import static org.openrewrite.maven.Assertions.pomXml; @@ -39,6 +41,7 @@ public void defaults(RecipeSpec spec) { } @Test + @DocumentExample void upgradeSpringCloudVersion() { rewriteRun( mavenProject("project", @@ -48,26 +51,20 @@ void upgradeSpringCloudVersion() { 4.0.0 - com.example fooservice 1.0-SNAPSHOT - - FooService - org.springframework.boot spring-boot-starter-parent 2.2.2.RELEASE - 11 Hoxton.SR9 2.18.3 - @@ -81,43 +78,11 @@ void upgradeSpringCloudVersion() { """, - """ - - 4.0.0 - - com.example - fooservice - 1.0-SNAPSHOT - - FooService - - - org.springframework.boot - spring-boot-starter-parent - 3.3.1 - - - - - 17 - 2023.0.2 - 2.18.3 - - - - - - org.springframework.cloud - spring-cloud-dependencies - ${spring-cloud.version} - pom - import - - - - - """ + spec -> spec.after(actual -> { + assertThat(actual).containsPattern("3.3.\\d+"); + assertThat(actual).containsPattern("2023.0.\\d+"); + return actual; + }) ) ) );