Skip to content

Commit 12db6c9

Browse files
Migrate Cassandra configuration to Spring Boot 3.0 in yaml format
1 parent 375be20 commit 12db6c9

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,17 @@ private void verifyYamlConfigurationUpdate() {
183183
" driverClassName: org.h2.Driver\n" +
184184
" jpa:\n" +
185185
" database-platform: org.hibernate.dialect.H2Dialect\n" +
186+
" cassandra:\n" +
187+
" keyspaceName: testKeySpace\n" +
188+
" contactPoints: localhost\n" +
189+
" port: 9042\n" +
190+
" username: testusername\n" +
191+
" schemaAction: NONE\n" +
192+
" request:\n" +
193+
" timeout: 10s\n" +
194+
" connection:\n" +
195+
" connectTimeout: 10s\n" +
196+
" initQueryTimeout: 10s\n" +
186197
" elasticsearch:\n" +
187198
" connection-timeout: '1'\n" +
188199
" password: testpassword\n" +

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ private void verifyYamlConfigurationUpdate() {
8787
" restclient.sniffer.delay-after-failure: '3'\n" +
8888
" restclient.sniffer.interval: '4'\n" +
8989
" username: username\n" +
90+
" cassandra:\n" +
91+
" keyspaceName: testKeySpace\n" +
92+
" contactPoints: localhost\n" +
93+
" port: 9042\n" +
94+
" username: testusername\n" +
95+
" schemaAction: NONE\n" +
96+
" request:\n" +
97+
" timeout: 10s\n" +
98+
" connection:\n" +
99+
" connectTimeout: 10s\n" +
100+
" initQueryTimeout: 10s\n" +
90101
" security:\n" +
91102
" saml2:\n" +
92103
" relyingparty:\n" +

applications/spring-shell/src/test/resources/testcode/boot-migration-27-30-multi-module/spring-app/src/main/resources/application.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ spring:
8585
socket-timeout: '100'
8686
max-in-memory-size: '122'
8787
username: testUser
88+
cassandra:
89+
keyspaceName: testKeySpace
90+
contactPoints: localhost
91+
port: 9042
92+
username: testusername
93+
schemaAction: NONE
94+
request:
95+
timeout: 10s
96+
connection:
97+
connectTimeout: 10s
98+
initQueryTimeout: 10s
8899
h2:
89100
console:
90101
path: "/tmp"

applications/spring-shell/src/test/resources/testcode/boot-migration-27-30/src/main/resources/application.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ spring:
8585
socket-timeout: '100'
8686
max-in-memory-size: '122'
8787
username: testUser
88+
cassandra:
89+
keyspaceName: testKeySpace
90+
contactPoints: localhost
91+
port: 9042
92+
username: testusername
93+
schemaAction: NONE
94+
request:
95+
timeout: 10s
96+
connection:
97+
connectTimeout: 10s
98+
initQueryTimeout: 10s
8899
h2:
89100
console:
90101
path: "/tmp"

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@
107107
recipeList:
108108
- org.springframework.sbm.boot.upgrade_27_30.SamlRelyingPartyPropertyApplicationPropertiesMove
109109
110+
- type: org.springframework.sbm.engine.recipe.OpenRewriteDeclarativeRecipeAdapter
111+
condition:
112+
type: org.springframework.sbm.boot.common.conditions.IsSpringBootProject
113+
versionPattern: "3\\.0\\..*"
114+
description: Migrate Cassandra configuration to Spring Boot 3.0 in yaml format
115+
openRewriteRecipe: |-
116+
type: specs.openrewrite.org/v1beta/recipe
117+
name: org.openrewrite.java.spring.boot2.SpringBootPropertiesManual_2_7
118+
displayName: Migrate Cassandra configuration to Spring Boot 3.0 in yaml format
119+
description: Renames spring.data.cassandra.(any) to spring.cassandra.(any)
120+
recipeList:
121+
- org.openrewrite.yaml.ChangeKey:
122+
oldKeyPath: $.spring.data.cassandra
123+
newKey:
124+
110125
- type: org.springframework.sbm.engine.recipe.OpenRewriteDeclarativeRecipeAdapter
111126
condition:
112127
type: org.springframework.sbm.boot.common.conditions.IsSpringBootProject

0 commit comments

Comments
 (0)