Skip to content

Commit 4687514

Browse files
Use version pattern in noDependencyManagementSection test (#7475)
ChangeDependencyGroupIdAndArtifactIdTest.noDependencyManagementSection hardcoded the post-recipe junit-jupiter version as 5.14.3, but the recipe resolves "5.x" against Maven Central at runtime. Every new junit-jupiter 5.x patch release breaks CI for every PR until someone bumps the literal. The most recent break is 5.14.4, published earlier today. Switch the assertion to a regex pattern matching any 5.x.x release, following the convention established in #6799 / #6856.
1 parent e1abb30 commit 4687514

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

rewrite-maven/src/test/java/org/openrewrite/maven/ChangeDependencyGroupIdAndArtifactIdTest.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,22 +3836,10 @@ void noDependencyManagementSection() {
38363836
</dependencies>
38373837
</project>
38383838
""",
3839-
"""
3840-
<project>
3841-
<modelVersion>4.0.0</modelVersion>
3842-
<groupId>com.example</groupId>
3843-
<artifactId>my-app</artifactId>
3844-
<version>1.0.0</version>
3845-
<dependencies>
3846-
<dependency>
3847-
<groupId>org.junit.jupiter</groupId>
3848-
<artifactId>junit-jupiter</artifactId>
3849-
<version>5.14.3</version>
3850-
<scope>test</scope>
3851-
</dependency>
3852-
</dependencies>
3853-
</project>
3854-
"""
3839+
spec -> spec.after(actual -> assertThat(actual)
3840+
.containsPattern("<groupId>org\\.junit\\.jupiter</groupId>\\s*<artifactId>junit-jupiter</artifactId>\\s*<version>5\\.\\d+(\\.\\d+)?</version>")
3841+
.doesNotContain("<groupId>junit</groupId>")
3842+
.actual())
38553843
)
38563844
);
38573845
}

0 commit comments

Comments
 (0)