Skip to content

Commit f7b4bc2

Browse files
Update type tables via ./gradlew createTypeTable (#808)
* Update type tables via > Configure project : Inferred project: rewrite-testing-frameworks, version: 3.17.0-SNAPSHOT > Task :createTypeTable UP-TO-DATE BUILD SUCCESSFUL in 652ms 1 actionable task: 1 up-to-date This commit updates the type tables using the task. * Update failing test to be future-proof * Use `assertThat` in `UseXMLUnitLegacyTest` --------- Co-authored-by: Tim te Beek <[email protected]>
1 parent 3c7d9cc commit f7b4bc2

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed
136 KB
Binary file not shown.

src/test/java/org/openrewrite/java/testing/junit5/UseXMLUnitLegacyTest.java

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
import org.openrewrite.test.RecipeSpec;
2020
import org.openrewrite.test.RewriteTest;
2121

22-
import java.util.regex.Matcher;
23-
import java.util.regex.Pattern;
24-
2522
import static org.assertj.core.api.Assertions.assertThat;
2623
import static org.openrewrite.java.Assertions.mavenProject;
2724
import static org.openrewrite.maven.Assertions.pomXml;
@@ -54,29 +51,10 @@ void shouldMigrateMavenDependency() {
5451
</dependencies>
5552
</project>
5653
""",
57-
spec -> spec.after(after -> {
58-
Matcher versionMatcher = Pattern.compile("<version>(.*)</version>").matcher(after);
59-
assertThat(versionMatcher.find()).isTrue();
60-
String projectVersion = versionMatcher.group(1);
61-
assertThat(versionMatcher.find()).isTrue();
62-
String xmlUnitVersion = versionMatcher.group(1);
63-
assertThat(xmlUnitVersion).isNotBlank();
64-
return """
65-
<project>
66-
<modelVersion>4.0.0</modelVersion>
67-
<groupId>com.example</groupId>
68-
<artifactId>demo</artifactId>
69-
<version>%s</version>
70-
<dependencies>
71-
<dependency>
72-
<groupId>org.xmlunit</groupId>
73-
<artifactId>xmlunit-legacy</artifactId>
74-
<version>%s</version>
75-
</dependency>
76-
</dependencies>
77-
</project>
78-
""".formatted(projectVersion, xmlUnitVersion);
79-
})
54+
spec -> spec.after(after ->
55+
assertThat(after)
56+
.containsPattern("<version>(2.10.+)</version>")
57+
.actual())
8058
)
8159
)
8260
);

0 commit comments

Comments
 (0)