Skip to content

Commit a8bc941

Browse files
Replace wiremock dependency when upgrading to Spring 3
1 parent b7d284c commit a8bc941

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

applications/spring-shell/src/test/java/org/springframework/sbm/BootUpgrade_27_30_IntegrationTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,19 @@ void migrateSimpleApplication() {
5656
verifyAutoConfigurationIsRefactored();
5757
verifyEhCacheVersionIsUpgraded();
5858
verifyJohnzonCoreDependencyIsUpgraded();
59+
verifyWireMockDependency();
5960
verifySpringCloudDependency();
61+
}
62+
63+
private void verifyWireMockDependency() {
64+
Optional<Dependency> wireMock =
65+
getDependencyByArtifactId("wiremock-jre8-standalone");
66+
67+
assertThat(wireMock).isPresent();
68+
assertThat(wireMock.get().getVersion()).isEqualTo("2.34.0");
6069
}
6170

6271
private void verifySpringCloudDependency() {
63-
6472
assertThat(getProperty("spring-cloud.version")).isEqualTo("2022.0.0-M4");
6573
}
6674

applications/spring-shell/src/test/resources/testcode/boot-migration-27-30/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
<artifactId>h2</artifactId>
3737
<scope>runtime</scope>
3838
</dependency>
39+
<dependency>
40+
<groupId>com.github.tomakehurst</groupId>
41+
<artifactId>wiremock-jre8</artifactId>
42+
<version>2.26.3</version>
43+
</dependency>
3944
<dependency>
4045
<groupId>io.projectreactor</groupId>
4146
<artifactId>reactor-core</artifactId>

components/sbm-recipes-boot-upgrade/src/main/resources/recipes/boot-2.7-3.0-dependency-version-update.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,30 @@
8888
artifactId: spring-boot-dependencies
8989
newVersion: 3.0.0-M3
9090
91+
- type: org.springframework.sbm.engine.recipe.OpenRewriteDeclarativeRecipeAdapter
92+
condition:
93+
type: org.springframework.sbm.boot.common.conditions.IsSpringBootProject
94+
versionPattern: "2\\.7\\..*|3\\.0\\..*"
95+
description: Miscellaneous migration that are required by Spring 3
96+
openRewriteRecipe: |-
97+
type: specs.openrewrite.org/v1beta/recipe
98+
name: org.openrewrite.java.spring.boot3.data.MiscSpring30
99+
displayName: Misc Upgrades to support SpringBoot 3.0
100+
description: 'Misc Upgrades to support SpringBoot 3.0'
101+
recipeList:
102+
- org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId:
103+
oldGroupId: com.github.tomakehurst
104+
oldArtifactId: wiremock-jre8
105+
newGroupId: com.github.tomakehurst
106+
newArtifactId: wiremock-jre8-standalone
107+
newVersion: 2.34.0
108+
- org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId:
109+
oldGroupId: com.github.tomakehurst
110+
oldArtifactId: wiremock-jre8
111+
newGroupId: com.github.tomakehurst
112+
newArtifactId: wiremock-jre8-standalone
113+
newVersion: 2.34.0
114+
91115
- type: org.springframework.sbm.build.migration.actions.SetProperty
92116
propertyName: "java.version"
93117
propertyValue: "17"

0 commit comments

Comments
 (0)