From 199a0064462351be4ca7820cf46ff3f5efc3b084 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Sun, 23 Aug 2026 20:41:31 +0200 Subject: [PATCH] Assert the resolved Stubborn Contract Maven plugin version `stubborn-contract-migration` 0.1.2 repins every migrated coordinate to `latest.release`, so the plugin version no longer stays at the Spring Cloud Contract version the pom started with. Assert on the shape of the resolved version instead of pinning it, so releases of the plugin don't break the build. --- .../MigrateFromSpringCloudContractTest.java | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/test/java/sh/stubborn/contract/migration/MigrateFromSpringCloudContractTest.java b/src/test/java/sh/stubborn/contract/migration/MigrateFromSpringCloudContractTest.java index 0173b0c..fafd59c 100644 --- a/src/test/java/sh/stubborn/contract/migration/MigrateFromSpringCloudContractTest.java +++ b/src/test/java/sh/stubborn/contract/migration/MigrateFromSpringCloudContractTest.java @@ -20,6 +20,7 @@ import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +import static org.assertj.core.api.Assertions.assertThat; import static org.openrewrite.maven.Assertions.pomXml; import static org.openrewrite.properties.Assertions.properties; import static org.openrewrite.yaml.Assertions.yaml; @@ -53,23 +54,9 @@ void migrateMavenPlugin() { """, - """ - - 4.0.0 - com.example - demo - 1.0.0 - - - - sh.stubborn - stubborn-contract-maven-plugin - 4.1.4 - - - - - """ + spec -> spec.after(actual -> assertThat(actual) + .containsPattern("sh\\.stubborn\\s*stubborn-contract-maven-plugin\\s*\\d+\\.\\d+\\.\\d+") + .actual()) ) ); }