Skip to content

Commit

Permalink
Added test case for #523 Java version not detected in parent
Browse files Browse the repository at this point in the history
  • Loading branch information
DidierLoiseau committed Sep 11, 2024
1 parent 0f9298e commit 57d617b
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,32 @@ void mavenUpgradeFromJava8ToJava17ViaProperties() {
);
}

@Test
void mavenUpgradeShouldDeclaredVersionInParent() {
rewriteRun(
spec -> spec.recipe(new UpgradeJavaVersion(17)),
pomXml(
//language=xml
"""
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.3</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
</project>
""",
spec -> spec.markers(new JavaVersion(UUID.randomUUID(), "", "", "11.0.15+10", "11.0.15+10"))
)
);
}

@Test
void mavenUpgradeFromJava8ToJava17ViaConfiguration() {
rewriteRun(
Expand Down

0 comments on commit 57d617b

Please sign in to comment.