Skip to content

Commit 8813a3f

Browse files
committed
Upgrade to Java 25, Spring Boot 4
1 parent 1b9c4d4 commit 8813a3f

5 files changed

Lines changed: 49 additions & 29 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/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: 1 addition & 1 deletion
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>

pom.xml

Lines changed: 37 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,12 @@
2424
</modules>
2525

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

31-
<pmd.version>6.55.0</pmd.version>
31+
<pmd.version>7.25.0</pmd.version>
32+
<lombok.version>1.18.46</lombok.version>
3233

3334
<!-- SonarCloud configuration -->
3435
<sonar.projectKey>SvenWoltmann_hexagonal-architecture-java</sonar.projectKey>
@@ -47,7 +48,7 @@
4748
<dependency>
4849
<groupId>org.projectlombok</groupId>
4950
<artifactId>lombok</artifactId>
50-
<version>1.18.30</version>
51+
<version>${lombok.version}</version>
5152
<scope>provided</scope>
5253
</dependency>
5354

@@ -76,8 +77,18 @@
7677
<dependencies>
7778
<dependency>
7879
<groupId>com.tngtech.archunit</groupId>
79-
<artifactId>archunit-junit5</artifactId>
80-
<version>1.1.0</version>
80+
<artifactId>archunit</artifactId>
81+
<version>1.4.2</version>
82+
</dependency>
83+
<dependency>
84+
<groupId>io.rest-assured</groupId>
85+
<artifactId>rest-assured</artifactId>
86+
<version>6.0.0</version>
87+
</dependency>
88+
<dependency>
89+
<groupId>org.testcontainers</groupId>
90+
<artifactId>mysql</artifactId>
91+
<version>1.21.4</version>
8192
</dependency>
8293
</dependencies>
8394
</dependencyManagement>
@@ -89,22 +100,31 @@
89100
<plugin>
90101
<groupId>org.apache.maven.plugins</groupId>
91102
<artifactId>maven-compiler-plugin</artifactId>
92-
<version>3.11.0</version>
103+
<version>3.15.0</version>
104+
<configuration>
105+
<annotationProcessorPaths>
106+
<path>
107+
<groupId>org.projectlombok</groupId>
108+
<artifactId>lombok</artifactId>
109+
<version>${lombok.version}</version>
110+
</path>
111+
</annotationProcessorPaths>
112+
</configuration>
93113
</plugin>
94114
<plugin>
95115
<groupId>org.apache.maven.plugins</groupId>
96116
<artifactId>maven-surefire-plugin</artifactId>
97-
<version>3.1.0</version>
117+
<version>3.5.6</version>
98118
</plugin>
99119
<plugin>
100120
<groupId>com.diffplug.spotless</groupId>
101121
<artifactId>spotless-maven-plugin</artifactId>
102-
<version>2.36.0</version>
122+
<version>3.6.0</version>
103123
<configuration>
104124
<java>
105125
<googleJavaFormat>
106126
<!-- Latest version can be found here: https://github.com/google/google-java-format/releases -->
107-
<version>1.17.0</version>
127+
<version>1.35.0</version>
108128
<style>GOOGLE</style>
109129
</googleJavaFormat>
110130
<lineEndings>UNIX</lineEndings>
@@ -126,7 +146,7 @@
126146
<plugin>
127147
<groupId>org.apache.maven.plugins</groupId>
128148
<artifactId>maven-jar-plugin</artifactId>
129-
<version>3.3.0</version>
149+
<version>3.5.0</version>
130150
</plugin>
131151
</plugins>
132152
</pluginManagement>
@@ -142,7 +162,7 @@
142162
<plugin>
143163
<groupId>org.jacoco</groupId>
144164
<artifactId>jacoco-maven-plugin</artifactId>
145-
<version>0.8.10</version>
165+
<version>0.8.15</version>
146166
<executions>
147167
<execution>
148168
<id>prepare-agent</id>
@@ -167,7 +187,7 @@
167187
<plugin>
168188
<groupId>com.github.spotbugs</groupId>
169189
<artifactId>spotbugs-maven-plugin</artifactId>
170-
<version>4.7.3.4</version>
190+
<version>4.10.2.0</version>
171191
<configuration>
172192
<excludeFilterFile>spotbugs-exclude.xml</excludeFilterFile>
173193
</configuration>
@@ -185,7 +205,7 @@
185205
<plugin>
186206
<groupId>org.apache.maven.plugins</groupId>
187207
<artifactId>maven-pmd-plugin</artifactId>
188-
<version>3.21.0</version>
208+
<version>3.28.0</version>
189209
<configuration>
190210
<targetJdk>19</targetJdk>
191211
<rulesets>
@@ -218,15 +238,15 @@
218238
<plugin>
219239
<groupId>org.apache.maven.plugins</groupId>
220240
<artifactId>maven-checkstyle-plugin</artifactId>
221-
<version>3.3.0</version>
241+
<version>3.6.0</version>
222242
<configuration>
223243
<configLocation>./google_checks.xml</configLocation>
224244
</configuration>
225245
<dependencies>
226246
<dependency>
227247
<groupId>com.puppycrawl.tools</groupId>
228248
<artifactId>checkstyle</artifactId>
229-
<version>10.12.0</version>
249+
<version>13.5.0</version>
230250
</dependency>
231251
</dependencies>
232252
<executions>

0 commit comments

Comments
 (0)