Skip to content

Commit 5752db5

Browse files
StefanHenkemofterdingeragoerler
authored
CAP Java 5 und Spring boot 4 migration (#602)
Requires a Spring Boot 4 compatible version of CAP Java and the BTP Security Library which are not yet available on Maven Central. --------- Co-authored-by: Markus Ofterdinger <markus.ofterdinger@sap.com> Co-authored-by: Adrian Görler <adrian.goerler@sap.com>
1 parent a6c659d commit 5752db5

13 files changed

Lines changed: 162 additions & 96 deletions

File tree

integration-tests/pom.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@
3535
<artifactId>spring-boot-starter-test</artifactId>
3636
<scope>test</scope>
3737
</dependency>
38+
<dependency>
39+
<groupId>org.springframework.boot</groupId>
40+
<artifactId>spring-boot-starter-webmvc-test</artifactId>
41+
<scope>test</scope>
42+
</dependency>
3843

3944
<dependency>
40-
<groupId>org.springframework.security</groupId>
41-
<artifactId>spring-security-test</artifactId>
45+
<groupId>org.springframework.boot</groupId>
46+
<artifactId>spring-boot-starter-security-test</artifactId>
4247
<scope>test</scope>
4348
</dependency>
4449
</dependencies>

integration-tests/src/test/java/my/bookshop/it/FeatureTogglesIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
import org.junit.jupiter.api.Test;
99
import org.springframework.beans.factory.annotation.Autowired;
10-
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
1110
import org.springframework.boot.test.context.SpringBootTest;
11+
import org.springframework.boot.webmvc.test.autoconfigure.AutoConfigureMockMvc;
1212
import org.springframework.security.test.context.support.WithMockUser;
1313
import org.springframework.test.context.ActiveProfiles;
1414
import org.springframework.test.web.servlet.MockMvc;

mtx/sidecar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"dependencies": {
33
"@cap-js/hana": "^2.8.0",
44
"@sap/cds": "^9.9.1",
5-
"@sap/cds-mtxs": "^3",
5+
"@sap/cds-mtxs": "^3.9.4",
66
"@sap/xssec": "^4.13.0",
77
"express": "^4.22.2"
88
},

package-lock.json

Lines changed: 59 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"version": "1.0.0",
44
"description": "Generated by cds-services-archetype",
55
"devDependencies": {
6+
"@sap/cds-compiler": "^6.9.3",
67
"@sap/cds-dk": "9.9.2",
7-
"@sap/cds-mtxs": "^3",
8-
"@sap/cds-compiler": "^6.9.3"
8+
"@sap/cds-mtxs": "^3.9.4"
99
},
1010
"workspaces": [
1111
"mtx/sidecar"

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>3.5.15</version>
8+
<version>4.1.0</version>
99
<relativePath/>
1010
<!-- lookup parent from repository -->
1111
</parent>
@@ -28,9 +28,9 @@
2828

2929
<!-- DEPENDENCIES VERSION -->
3030
<jdk.version>25</jdk.version>
31-
<cds.services.version>4.9.0</cds.services.version>
31+
<cds.services.version>5.0.0</cds.services.version>
3232
<cloud.sdk.version>5.31.0</cloud.sdk.version>
33-
<xsuaa.version>3.7.3</xsuaa.version>
33+
<xsuaa.version>4.0.7</xsuaa.version>
3434
<cf-java-logging-support.version>4.2.0</cf-java-logging-support.version>
3535
<cds-feature-attachments.version>1.5.0</cds-feature-attachments.version>
3636
</properties>
@@ -156,7 +156,7 @@
156156
<configuration>
157157
<rules>
158158
<requireMavenVersion>
159-
<version>3.6.3</version>
159+
<version>3.9.14</version>
160160
</requireMavenVersion>
161161
<requireJavaVersion>
162162
<version>${jdk.version}</version>

srv/pom.xml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@
110110
<artifactId>spring-boot-starter-security</artifactId>
111111
</dependency>
112112

113+
<dependency>
114+
<groupId>org.springframework.boot</groupId>
115+
<artifactId>spring-boot-starter-security-oauth2-resource-server</artifactId>
116+
</dependency>
117+
113118
<dependency>
114119
<groupId>org.springframework.boot</groupId>
115120
<artifactId>spring-boot-starter-actuator</artifactId>
@@ -122,14 +127,26 @@
122127
</dependency>
123128

124129
<dependency>
125-
<groupId>org.springframework.security</groupId>
126-
<artifactId>spring-security-test</artifactId>
130+
<groupId>org.springframework.boot</groupId>
131+
<artifactId>spring-boot-starter-security-test</artifactId>
132+
<scope>test</scope>
133+
</dependency>
134+
135+
<dependency>
136+
<groupId>org.springframework.boot</groupId>
137+
<artifactId>spring-boot-starter-webclient</artifactId>
138+
<scope>test</scope>
139+
</dependency>
140+
141+
<dependency>
142+
<groupId>org.springframework.boot</groupId>
143+
<artifactId>spring-boot-webtestclient</artifactId>
127144
<scope>test</scope>
128145
</dependency>
129146

130147
<dependency>
131148
<groupId>org.springframework.boot</groupId>
132-
<artifactId>spring-boot-starter-webflux</artifactId>
149+
<artifactId>spring-boot-starter-webmvc-test</artifactId>
133150
<scope>test</scope>
134151
</dependency>
135152

srv/src/main/java/my/bookshop/health/CustomHealthIndicator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package my.bookshop.health;
22

3-
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
4-
import org.springframework.boot.actuate.health.Health;
5-
import org.springframework.boot.actuate.health.HealthIndicator;
3+
import org.springframework.boot.health.autoconfigure.contributor.ConditionalOnEnabledHealthIndicator;
4+
import org.springframework.boot.health.contributor.Health;
5+
import org.springframework.boot.health.contributor.HealthIndicator;
66
import org.springframework.stereotype.Component;
77

88
/** Custom health indicator implementation. */

srv/src/test/java/my/bookshop/AdminServiceAddress_default_ITest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.junit.jupiter.api.Test;
44
import org.springframework.boot.test.context.SpringBootTest;
55
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
6+
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
67
import org.springframework.test.context.ActiveProfiles;
78

89
/**
@@ -12,6 +13,7 @@
1213
*/
1314
@ActiveProfiles("default")
1415
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
16+
@AutoConfigureWebTestClient
1517
class AdminServiceAddress_default_ITest extends AdminServiceAddressITestBase {
1618

1719
@Test

srv/src/test/java/my/bookshop/AdminServiceAddress_mocked_ITest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.junit.jupiter.api.Test;
44
import org.springframework.boot.test.context.SpringBootTest;
55
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
6+
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
67
import org.springframework.test.context.ActiveProfiles;
78

89
/**
@@ -16,6 +17,7 @@
1617
webEnvironment = WebEnvironment.RANDOM_PORT,
1718
properties =
1819
"cds.remote.services.'[API_BUSINESS_PARTNER]'.destination.name=myself-AdminServiceAddressITest")
20+
@AutoConfigureWebTestClient
1921
class AdminServiceAddress_mocked_ITest extends AdminServiceAddressITestBase {
2022

2123
@Test

0 commit comments

Comments
 (0)