Skip to content

Commit fce4480

Browse files
authored
Avoid hardcoded patch version in JavaxValidationMigrationToJakartaValidationTest (#1362)
hibernate-validator 7.0.7.Final reached Maven Central on 2026-10-25, breaking the hardcoded 7.0.6.Final expectation, as 7.0.6.Final broke the 7.0.5.Final one in #1321. The recipe upgrades to the newest 7.0.x, so assert on any 7.0.x.Final under the new groupId with the test scope kept, matching the surrounding tests.
1 parent 48dcd43 commit fce4480

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

‎src/test/java/org/openrewrite/java/migrate/jakarta/JavaxValidationMigrationToJakartaValidationTest.java‎

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,22 +115,14 @@ void migrateLegacyHibernateValidatorProvider() {
115115
</dependencies>
116116
</project>
117117
""",
118-
"""
119-
<project>
120-
<modelVersion>4.0.0</modelVersion>
121-
<groupId>com.example</groupId>
122-
<artifactId>app</artifactId>
123-
<version>1</version>
124-
<dependencies>
125-
<dependency>
126-
<groupId>org.hibernate.validator</groupId>
127-
<artifactId>hibernate-validator</artifactId>
128-
<version>7.0.6.Final</version>
129-
<scope>test</scope>
130-
</dependency>
131-
</dependencies>
132-
</project>
133-
"""
118+
spec -> spec.after(pom -> assertThat(pom)
119+
.containsPattern("""
120+
<groupId>org\\.hibernate\\.validator</groupId>\\s*\
121+
<artifactId>hibernate-validator</artifactId>\\s*\
122+
<version>7\\.0\\.\\d+\\.Final</version>\\s*\
123+
<scope>test</scope>""")
124+
.doesNotContain("<groupId>org.hibernate</groupId>")
125+
.actual())
134126
)
135127
);
136128
}

0 commit comments

Comments
 (0)