Skip to content

Commit

Permalink
Moved test for #523 to more relevant class
Browse files Browse the repository at this point in the history
  • Loading branch information
DidierLoiseau committed Sep 17, 2024
1 parent 1e9894a commit bfcc1f3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,32 +77,6 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,28 @@ void addReleaseIfNoOtherChangeIsMade() {
)
);
}

@Test
void mavenUpgradeShouldUseDeclaredVersionInParent() {
rewriteRun(
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>
"""
)
);
}
}

0 comments on commit bfcc1f3

Please sign in to comment.