Skip to content

Commit dd1f01f

Browse files
chore(deps): update plugin org.springframework.boot to v4 (#347)
* chore(deps): update plugin org.springframework.boot to v4 * fix(deps): update MongoDB URI property and improve test configuration * fix(deps): revert testcontainers dependencies to version 1.21.4 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: eric <psytraxx@gmail.com>
1 parent ee6452e commit dd1f01f

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

backend/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id "org.springframework.boot" version "3.5.13"
3+
id "org.springframework.boot" version "4.0.5"
44
id 'io.spring.dependency-management' version '1.1.7'
55
id 'jacoco' // Add JaCoCo plugin
66
}
@@ -22,10 +22,9 @@ dependencies {
2222
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.44'
2323
annotationProcessor 'org.projectlombok:lombok:1.18.44'
2424
// end::actuator[]
25-
implementation 'org.springframework.boot:spring-boot-starter-web'
2625
// tag::tests[]
27-
// Add Spring Boot's core testing module
28-
testImplementation 'org.springframework.boot:spring-boot-test'
26+
testImplementation 'org.springframework.boot:spring-boot-starter-webflux-test'
27+
testImplementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive-test'
2928

3029
testCompileOnly 'org.projectlombok:lombok:1.18.44'
3130
testAnnotationProcessor 'org.projectlombok:lombok:1.18.44'
@@ -34,9 +33,9 @@ dependencies {
3433
testImplementation 'io.projectreactor:reactor-test' // Add this for StepVerifier
3534

3635
// Test containers
37-
testImplementation platform('org.testcontainers:testcontainers-bom:2.0.4')
38-
testImplementation 'org.testcontainers:junit-jupiter'
39-
testImplementation 'org.testcontainers:mongodb'
36+
testImplementation platform('org.testcontainers:testcontainers-bom:1.21.4')
37+
testImplementation 'org.testcontainers:junit-jupiter:1.21.4'
38+
testImplementation 'org.testcontainers:mongodb:1.21.4'
4039
// end::tests[]
4140

4241
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
spring.data.mongodb.uri=mongodb://${DB_HOST:localhost}:27017/chat_app_db
1+
spring.mongodb.uri=mongodb://${DB_HOST:localhost}:27017/chat_app_db
22
logging.level.org.springframework.data.mongodb.core.MongoTemplate=DEBUG
33
## Hibernate Logging
44
logging.level.org.hibernate.SQL=DEBUG

backend/src/test/java/com/ssechat/controller/ChatMessageControllerTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.junit.jupiter.api.Test;
77
import org.junit.jupiter.api.extension.ExtendWith;
88
import org.springframework.beans.factory.annotation.Autowired;
9+
import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
910
import org.springframework.boot.test.context.SpringBootTest;
1011
import org.springframework.http.MediaType;
1112
import org.springframework.test.context.DynamicPropertyRegistry;
@@ -22,6 +23,7 @@
2223

2324
@ExtendWith(SpringExtension.class)
2425
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
26+
@AutoConfigureWebTestClient
2527
@Testcontainers
2628
class ChatMessageControllerTest {
2729

@@ -38,7 +40,7 @@ class ChatMessageControllerTest {
3840

3941
@DynamicPropertySource
4042
static void setProperties(DynamicPropertyRegistry registry) {
41-
registry.add("spring.data.mongodb.uri", mongoDBContainer::getReplicaSetUrl);
43+
registry.add("spring.mongodb.uri", mongoDBContainer::getReplicaSetUrl);
4244
}
4345

4446
@Autowired

0 commit comments

Comments
 (0)