Skip to content

Commit 54fecea

Browse files
committed
Upgrade to Java 25, Spring Boot 4
1 parent 1b9c4d4 commit 54fecea

6 files changed

Lines changed: 45 additions & 31 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ jobs:
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v6
1818
with:
1919
fetch-depth: 0 # Fetch all history for all branches and tags (otherwise Sonar will report: "Shallow clone detected, no blame information will be provided.")
2020

2121
- name: Set up JDK
22-
uses: actions/setup-java@v3
22+
uses: actions/setup-java@v5
2323
with:
2424
distribution: 'temurin'
25-
java-version: 20
25+
java-version: 25
2626

2727
- name: Cache SonarCloud packages
28-
uses: actions/cache@v3
28+
uses: actions/cache@v5
2929
with:
3030
path: ~/.sonar/cache
3131
key: ${{ runner.os }}-sonar
3232
restore-keys: ${{ runner.os }}-sonar
3333

3434
- name: Cache Maven packages
35-
uses: actions/cache@v3
35+
uses: actions/cache@v5
3636
with:
3737
path: ~/.m2
3838
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}

adapter/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
</dependency>
5959
<dependency>
6060
<groupId>org.testcontainers</groupId>
61-
<artifactId>mysql</artifactId>
61+
<artifactId>testcontainers-mysql</artifactId>
6262
<scope>test</scope>
6363
</dependency>
6464

adapter/src/test/java/eu/happycoders/shop/adapter/in/rest/cart/CartsControllerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import org.junit.jupiter.api.Test;
2424
import org.springframework.boot.test.context.SpringBootTest;
2525
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
26-
import org.springframework.boot.test.mock.mockito.MockBean;
2726
import org.springframework.boot.test.web.server.LocalServerPort;
2827
import org.springframework.test.context.ActiveProfiles;
28+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2929

3030
@ActiveProfiles("test")
3131
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@@ -37,9 +37,9 @@ class CartsControllerTest {
3737

3838
@LocalServerPort private Integer port;
3939

40-
@MockBean AddToCartUseCase addToCartUseCase;
41-
@MockBean GetCartUseCase getCartUseCase;
42-
@MockBean EmptyCartUseCase emptyCartUseCase;
40+
@MockitoBean AddToCartUseCase addToCartUseCase;
41+
@MockitoBean GetCartUseCase getCartUseCase;
42+
@MockitoBean EmptyCartUseCase emptyCartUseCase;
4343

4444
@Test
4545
void givenASyntacticallyInvalidCustomerId_getCart_returnsAnError() {

adapter/src/test/java/eu/happycoders/shop/adapter/in/rest/product/ProductsControllerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
import org.junit.jupiter.api.Test;
1616
import org.springframework.boot.test.context.SpringBootTest;
1717
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
18-
import org.springframework.boot.test.mock.mockito.MockBean;
1918
import org.springframework.boot.test.web.server.LocalServerPort;
2019
import org.springframework.test.context.ActiveProfiles;
20+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2121

2222
@ActiveProfiles("test")
2323
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@@ -28,7 +28,7 @@ class ProductsControllerTest {
2828

2929
@LocalServerPort private Integer port;
3030

31-
@MockBean FindProductsUseCase findProductsUseCase;
31+
@MockitoBean FindProductsUseCase findProductsUseCase;
3232

3333
@Test
3434
void givenAQueryAndAListOfProducts_findProducts_requestsProductsViaQueryAndReturnsThem() {

bootstrap/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</dependency>
4141
<dependency>
4242
<groupId>com.tngtech.archunit</groupId>
43-
<artifactId>archunit-junit5</artifactId>
43+
<artifactId>archunit</artifactId>
4444
<scope>test</scope>
4545
</dependency>
4646
<dependency>
@@ -50,7 +50,7 @@
5050
</dependency>
5151
<dependency>
5252
<groupId>org.testcontainers</groupId>
53-
<artifactId>mysql</artifactId>
53+
<artifactId>testcontainers-mysql</artifactId>
5454
<scope>test</scope>
5555
</dependency>
5656

pom.xml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.springframework.boot</groupId>
99
<artifactId>spring-boot-starter-parent</artifactId>
10-
<version>3.1.5</version>
10+
<version>4.1.0</version>
1111
</parent>
1212

1313
<groupId>eu.happycoders.shop</groupId>
@@ -24,11 +24,11 @@
2424
</modules>
2525

2626
<properties>
27-
<maven.compiler.source>20</maven.compiler.source>
28-
<maven.compiler.target>20</maven.compiler.target>
27+
<maven.compiler.release>25</maven.compiler.release>
2928
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3029

31-
<pmd.version>6.55.0</pmd.version>
30+
<pmd.version>7.25.0</pmd.version>
31+
<lombok.version>1.18.46</lombok.version>
3232

3333
<!-- SonarCloud configuration -->
3434
<sonar.projectKey>SvenWoltmann_hexagonal-architecture-java</sonar.projectKey>
@@ -47,7 +47,7 @@
4747
<dependency>
4848
<groupId>org.projectlombok</groupId>
4949
<artifactId>lombok</artifactId>
50-
<version>1.18.30</version>
50+
<version>${lombok.version}</version>
5151
<scope>provided</scope>
5252
</dependency>
5353

@@ -76,8 +76,13 @@
7676
<dependencies>
7777
<dependency>
7878
<groupId>com.tngtech.archunit</groupId>
79-
<artifactId>archunit-junit5</artifactId>
80-
<version>1.1.0</version>
79+
<artifactId>archunit</artifactId>
80+
<version>1.4.2</version>
81+
</dependency>
82+
<dependency>
83+
<groupId>io.rest-assured</groupId>
84+
<artifactId>rest-assured</artifactId>
85+
<version>6.0.0</version>
8186
</dependency>
8287
</dependencies>
8388
</dependencyManagement>
@@ -89,22 +94,31 @@
8994
<plugin>
9095
<groupId>org.apache.maven.plugins</groupId>
9196
<artifactId>maven-compiler-plugin</artifactId>
92-
<version>3.11.0</version>
97+
<version>3.15.0</version>
98+
<configuration>
99+
<annotationProcessorPaths>
100+
<path>
101+
<groupId>org.projectlombok</groupId>
102+
<artifactId>lombok</artifactId>
103+
<version>${lombok.version}</version>
104+
</path>
105+
</annotationProcessorPaths>
106+
</configuration>
93107
</plugin>
94108
<plugin>
95109
<groupId>org.apache.maven.plugins</groupId>
96110
<artifactId>maven-surefire-plugin</artifactId>
97-
<version>3.1.0</version>
111+
<version>3.5.6</version>
98112
</plugin>
99113
<plugin>
100114
<groupId>com.diffplug.spotless</groupId>
101115
<artifactId>spotless-maven-plugin</artifactId>
102-
<version>2.36.0</version>
116+
<version>3.6.0</version>
103117
<configuration>
104118
<java>
105119
<googleJavaFormat>
106120
<!-- Latest version can be found here: https://github.com/google/google-java-format/releases -->
107-
<version>1.17.0</version>
121+
<version>1.35.0</version>
108122
<style>GOOGLE</style>
109123
</googleJavaFormat>
110124
<lineEndings>UNIX</lineEndings>
@@ -126,7 +140,7 @@
126140
<plugin>
127141
<groupId>org.apache.maven.plugins</groupId>
128142
<artifactId>maven-jar-plugin</artifactId>
129-
<version>3.3.0</version>
143+
<version>3.5.0</version>
130144
</plugin>
131145
</plugins>
132146
</pluginManagement>
@@ -142,7 +156,7 @@
142156
<plugin>
143157
<groupId>org.jacoco</groupId>
144158
<artifactId>jacoco-maven-plugin</artifactId>
145-
<version>0.8.10</version>
159+
<version>0.8.15</version>
146160
<executions>
147161
<execution>
148162
<id>prepare-agent</id>
@@ -167,7 +181,7 @@
167181
<plugin>
168182
<groupId>com.github.spotbugs</groupId>
169183
<artifactId>spotbugs-maven-plugin</artifactId>
170-
<version>4.7.3.4</version>
184+
<version>4.10.2.0</version>
171185
<configuration>
172186
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
173187
</configuration>
@@ -185,7 +199,7 @@
185199
<plugin>
186200
<groupId>org.apache.maven.plugins</groupId>
187201
<artifactId>maven-pmd-plugin</artifactId>
188-
<version>3.21.0</version>
202+
<version>3.28.0</version>
189203
<configuration>
190204
<targetJdk>19</targetJdk>
191205
<rulesets>
@@ -218,15 +232,15 @@
218232
<plugin>
219233
<groupId>org.apache.maven.plugins</groupId>
220234
<artifactId>maven-checkstyle-plugin</artifactId>
221-
<version>3.3.0</version>
235+
<version>3.6.0</version>
222236
<configuration>
223237
<configLocation>./google_checks.xml</configLocation>
224238
</configuration>
225239
<dependencies>
226240
<dependency>
227241
<groupId>com.puppycrawl.tools</groupId>
228242
<artifactId>checkstyle</artifactId>
229-
<version>10.12.0</version>
243+
<version>13.5.0</version>
230244
</dependency>
231245
</dependencies>
232246
<executions>

0 commit comments

Comments
 (0)