Skip to content

Commit 40952ba

Browse files
authored
BAEL-7136: Remove spring-testing dependency on the parent POM and fix the dependencies to fix the integration tests (eugenp#15940)
1 parent cb3b854 commit 40952ba

3 files changed

Lines changed: 96 additions & 19 deletions

File tree

testing-modules/spring-testing/pom.xml

Lines changed: 76 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6+
<groupId>com.baeldung</groupId>
67
<artifactId>spring-testing</artifactId>
78
<version>0.1-SNAPSHOT</version>
89
<name>spring-testing</name>
910

10-
<parent>
11-
<groupId>com.baeldung</groupId>
12-
<artifactId>parent-boot-2</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
14-
<relativePath>../../parent-boot-2</relativePath>
15-
</parent>
16-
1711
<dependencies>
12+
<dependency>
13+
<groupId>ch.qos.logback</groupId>
14+
<artifactId>logback-classic</artifactId>
15+
<version>1.5.0</version>
16+
<scope>test</scope>
17+
</dependency>
1818
<dependency>
1919
<groupId>org.hamcrest</groupId>
2020
<artifactId>java-hamcrest</artifactId>
@@ -23,29 +23,66 @@
2323
<dependency>
2424
<groupId>org.projectlombok</groupId>
2525
<artifactId>lombok</artifactId>
26-
<version>${lombok.version}</version>
26+
<version>1.18.30</version>
2727
<scope>provided</scope>
2828
</dependency>
2929
<dependency>
3030
<groupId>org.springframework.boot</groupId>
3131
<artifactId>spring-boot-starter</artifactId>
32+
<version>3.2.2</version>
33+
<exclusions>
34+
<exclusion>
35+
<groupId>org.springframework.boot</groupId>
36+
<artifactId>spring-boot-starter-logging</artifactId>
37+
</exclusion>
38+
</exclusions>
3239
</dependency>
33-
<!-- test scoped -->
3440
<dependency>
3541
<groupId>org.springframework.boot</groupId>
36-
<artifactId>spring-boot-starter-test</artifactId>
37-
<scope>test</scope>
42+
<artifactId>spring-boot</artifactId>
43+
<version>3.2.2</version>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.springframework.data</groupId>
47+
<artifactId>spring-data-jpa</artifactId>
48+
<version>3.2.2</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.springframework.data</groupId>
52+
<artifactId>spring-data-commons</artifactId>
53+
<version>3.2.2</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.springframework</groupId>
57+
<artifactId>spring-beans</artifactId>
58+
<version>${spring.version}</version>
3859
</dependency>
3960
<dependency>
4061
<groupId>org.springframework</groupId>
4162
<artifactId>spring-core</artifactId>
4263
<version>${spring.version}</version>
64+
<scope>compile</scope>
4365
</dependency>
4466
<dependency>
4567
<groupId>org.springframework</groupId>
4668
<artifactId>spring-context</artifactId>
4769
<version>${spring.version}</version>
4870
</dependency>
71+
<dependency>
72+
<groupId>org.springframework</groupId>
73+
<artifactId>spring-expression</artifactId>
74+
<version>${spring.version}</version>
75+
</dependency>
76+
<dependency>
77+
<groupId>org.springframework</groupId>
78+
<artifactId>spring-test</artifactId>
79+
<version>${spring.version}</version>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.springframework</groupId>
83+
<artifactId>spring-web</artifactId>
84+
<version>${spring.version}</version>
85+
</dependency>
4986
<dependency>
5087
<groupId>org.springframework</groupId>
5188
<artifactId>spring-webmvc</artifactId>
@@ -56,20 +93,41 @@
5693
<artifactId>javax.persistence</artifactId>
5794
<version>${javax.persistence.version}</version>
5895
</dependency>
59-
<dependency>
60-
<groupId>org.springframework.data</groupId>
61-
<artifactId>spring-data-jpa</artifactId>
62-
</dependency>
6396
<dependency>
6497
<groupId>org.awaitility</groupId>
6598
<artifactId>awaitility</artifactId>
6699
<version>${awaitility.version}</version>
67100
<scope>test</scope>
68101
</dependency>
69102
<dependency>
70-
<groupId>javax.servlet</groupId>
71-
<artifactId>javax.servlet-api</artifactId>
72-
<version>${javax.servlet-api.version}</version>
103+
<groupId>jakarta.servlet</groupId>
104+
<artifactId>jakarta.servlet-api</artifactId>
105+
<version>6.0.0</version>
106+
</dependency>
107+
<!-- test scoped -->
108+
<dependency>
109+
<groupId>org.springframework.boot</groupId>
110+
<artifactId>spring-boot-starter-test</artifactId>
111+
<scope>test</scope>
112+
<version>3.2.2</version>
113+
<exclusions>
114+
<exclusion>
115+
<groupId>org.springframework.boot</groupId>
116+
<artifactId>spring-boot-starter-logging</artifactId>
117+
</exclusion>
118+
</exclusions>
119+
</dependency>
120+
<dependency>
121+
<groupId>org.junit.jupiter</groupId>
122+
<artifactId>junit-jupiter</artifactId>
123+
<version>5.9.2</version>
124+
<scope>test</scope>
125+
</dependency>
126+
<dependency>
127+
<groupId>org.junit.vintage</groupId>
128+
<artifactId>junit-vintage-engine</artifactId>
129+
<version>5.9.2</version>
130+
<scope>test</scope>
73131
</dependency>
74132
</dependencies>
75133

testing-modules/spring-testing/src/main/java/com/baeldung/config/WebConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.springframework.context.annotation.Configuration;
66
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
77

8-
import javax.servlet.ServletContext;
8+
import jakarta.servlet.ServletContext;
99

1010
@EnableWebMvc
1111
@Configuration
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
4+
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
5+
6+
<springProfile name="!dev">
7+
<root level="INFO">
8+
<!-- This is for the local environment -->
9+
<appender-ref ref="CONSOLE"/>
10+
</root>
11+
</springProfile>
12+
13+
<springProfile name="dev">
14+
<include resource="com/google/cloud/spring/logging/logback-json-appender.xml"/>
15+
<root level="INFO">
16+
<appender-ref ref="CONSOLE_JSON"/>
17+
</root>
18+
</springProfile>
19+
</configuration>

0 commit comments

Comments
 (0)