From f6982949d775cef53900773db83687bbf08c7e90 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 23 Nov 2025 05:34:15 +0000
Subject: [PATCH 1/9] fix(deps): update dependency
org.springframework.boot:spring-boot-starter-parent to v4.0.0
---
boot-mongodb-elasticsearch/pom.xml | 2 +-
httpClients/boot-rest-template/pom.xml | 2 +-
scheduler/boot-scheduler-quartz/pom.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/boot-mongodb-elasticsearch/pom.xml b/boot-mongodb-elasticsearch/pom.xml
index 546c8c544..32df1d4ce 100644
--- a/boot-mongodb-elasticsearch/pom.xml
+++ b/boot-mongodb-elasticsearch/pom.xml
@@ -6,7 +6,7 @@
org.springframework.boot
spring-boot-starter-parent
- 4.0.0-M1
+ 4.0.0
com.example.mongoes
diff --git a/httpClients/boot-rest-template/pom.xml b/httpClients/boot-rest-template/pom.xml
index b0b085373..aacd96159 100644
--- a/httpClients/boot-rest-template/pom.xml
+++ b/httpClients/boot-rest-template/pom.xml
@@ -5,7 +5,7 @@
org.springframework.boot
spring-boot-starter-parent
- 4.0.0-RC2
+ 4.0.0
com.example.rest.template
diff --git a/scheduler/boot-scheduler-quartz/pom.xml b/scheduler/boot-scheduler-quartz/pom.xml
index b6233e075..19c93a9a0 100644
--- a/scheduler/boot-scheduler-quartz/pom.xml
+++ b/scheduler/boot-scheduler-quartz/pom.xml
@@ -7,7 +7,7 @@
org.springframework.boot
spring-boot-starter-parent
- 4.0.0-RC1
+ 4.0.0
com.scheduler.quartz
From 2e92480f713f5bf5fe3427ff4863e994fc415fb7 Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 05:51:25 +0000
Subject: [PATCH 2/9] attempt to upgrade
---
boot-mongodb-elasticsearch/pom.xml | 15 +++++----------
.../java/com/example/mongoes/document/Grades.java | 2 +-
.../main/resources/application-cluster.properties | 2 +-
.../src/main/resources/application.properties | 4 ++--
.../example/mongoes/common/ContainersConfig.java | 2 +-
5 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/boot-mongodb-elasticsearch/pom.xml b/boot-mongodb-elasticsearch/pom.xml
index 32df1d4ce..929c70e7f 100644
--- a/boot-mongodb-elasticsearch/pom.xml
+++ b/boot-mongodb-elasticsearch/pom.xml
@@ -48,7 +48,7 @@
org.springframework.boot
- spring-boot-starter-aop
+ spring-boot-starter-aspectj
org.springframework.boot
@@ -89,7 +89,7 @@
org.springframework.boot
- spring-boot-starter-test
+ spring-boot-starter-webflux-test
test
@@ -97,24 +97,19 @@
spring-boot-testcontainers
test
-
- io.projectreactor
- reactor-test
- test
-
org.testcontainers
- junit-jupiter
+ testcontainers-junit-jupiter
test
org.testcontainers
- mongodb
+ testcontainers-mongodb
test
org.testcontainers
- elasticsearch
+ testcontainers-elasticsearch
test
diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java
index 283c5c3e3..5895fa7d1 100644
--- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java
+++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java
@@ -1,11 +1,11 @@
package com.example.mongoes.document;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import java.time.LocalDateTime;
import java.util.StringJoiner;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
+import tools.jackson.databind.annotation.JsonDeserialize;
public class Grades {
private String grade;
diff --git a/boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties b/boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties
index 6d6d3e52b..3d257a9c9 100644
--- a/boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties
+++ b/boot-mongodb-elasticsearch/src/main/resources/application-cluster.properties
@@ -1,2 +1,2 @@
#clusterURL
-spring.data.mongodb.uri=mongodb://localhost:27017,localhost:27018,localhost:27019/mongoes?replicaSet=myReplicaSet
+spring.mongodb.uri=mongodb://localhost:27017,localhost:27018,localhost:27019/mongoes?replicaSet=myReplicaSet
diff --git a/boot-mongodb-elasticsearch/src/main/resources/application.properties b/boot-mongodb-elasticsearch/src/main/resources/application.properties
index a3b6d9d92..8d1566e61 100644
--- a/boot-mongodb-elasticsearch/src/main/resources/application.properties
+++ b/boot-mongodb-elasticsearch/src/main/resources/application.properties
@@ -23,8 +23,8 @@ spring.jackson.serialization.fail-on-empty-beans=false
#spring.data.mongodb.authentication-database=admin
#spring.data.mongodb.username=admin
#spring.data.mongodb.password=passcode
-spring.data.mongodb.database=mongoes
-spring.data.mongodb.uri=mongodb://localhost:27017/mongoes?replicaSet=rs0&readPreference=primary&directConnection=true
+spring.mongodb.database=mongoes
+spring.mongodb.uri=mongodb://localhost:27017/mongoes?replicaSet=rs0&readPreference=primary&directConnection=true
spring.elasticsearch.uris=localhost:9200
spring.elasticsearch.socket-timeout=10s
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/ContainersConfig.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/ContainersConfig.java
index 9e4ed6314..fd49380d8 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/ContainersConfig.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/ContainersConfig.java
@@ -5,8 +5,8 @@
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
-import org.testcontainers.containers.MongoDBContainer;
import org.testcontainers.elasticsearch.ElasticsearchContainer;
+import org.testcontainers.mongodb.MongoDBContainer;
import org.testcontainers.utility.DockerImageName;
@TestConfiguration(proxyBeanMethods = false)
From f23fd9e5487342ce16bd9cb287c9cc1db583467d Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 05:55:02 +0000
Subject: [PATCH 3/9] upgrade
---
.../src/main/java/com/scheduler/quartz/config/WebMvcConfig.java | 2 +-
.../src/main/resources/application.properties | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/config/WebMvcConfig.java b/scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/config/WebMvcConfig.java
index c115f3dc1..036f17fd1 100644
--- a/scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/config/WebMvcConfig.java
+++ b/scheduler/boot-scheduler-quartz/src/main/java/com/scheduler/quartz/config/WebMvcConfig.java
@@ -1,7 +1,7 @@
package com.scheduler.quartz.config;
+import org.jspecify.annotations.NonNull;
import org.springframework.context.annotation.Configuration;
-import org.springframework.lang.NonNull;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
diff --git a/scheduler/boot-scheduler-quartz/src/main/resources/application.properties b/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
index 352147acb..27c2e1d03 100644
--- a/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
+++ b/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
@@ -9,7 +9,7 @@ spring.threads.virtual.enabled=true
################ Actuator #####################
management.endpoints.web.exposure.include=configprops,env,health,info,logfile,loggers,metrics,prometheus,quartz
management.endpoint.health.show-details=always
-management.endpoint.quartz.enabled=true
+management.endpoint.quartz.access=read-only
################ Database #####################
spring.jpa.show-sql=false
From 4fdf8633d90a0508544ddec4fddb15ffee30c788 Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 06:13:16 +0000
Subject: [PATCH 4/9] attempt to fix compilation issues
---
.../src/main/java/com/example/mongoes/document/Grades.java | 2 +-
.../com/example/mongoes/common/AbstractIntegrationTest.java | 2 +-
.../mongoes/web/controller/RestaurantControllerTest.java | 2 +-
.../example/mongoes/web/controller/SearchControllerTest.java | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java
index 5895fa7d1..5633022cc 100644
--- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java
+++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/document/Grades.java
@@ -1,11 +1,11 @@
package com.example.mongoes.document;
-import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import java.time.LocalDateTime;
import java.util.StringJoiner;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import tools.jackson.databind.annotation.JsonDeserialize;
+import tools.jackson.databind.ext.javatime.deser.LocalDateTimeDeserializer;
public class Grades {
private String grade;
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
index 2d01ce46a..3c83bdb71 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/common/AbstractIntegrationTest.java
@@ -5,8 +5,8 @@
import com.example.mongoes.repository.elasticsearch.RestaurantESRepository;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.webtestclient.autoconfigure.AutoConfigureWebTestClient;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.reactive.server.WebTestClient;
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
index 86a7d1b8b..c7fa0fdca 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
@@ -18,7 +18,7 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
+import org.springframework.boot.webflux.test.autoconfigure.WebFluxTest;
import org.springframework.data.geo.Point;
import org.springframework.http.MediaType;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
index a67c892ac..9f2929887 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
@@ -13,7 +13,7 @@
import org.junit.jupiter.params.provider.CsvSource;
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
+import org.springframework.boot.webflux.test.autoconfigure.WebFluxTest;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.web.reactive.server.WebTestClient;
import reactor.core.publisher.Flux;
From 9ffe1459b4fe01b24991beacc068b5dd05850fd5 Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 17:16:00 +0000
Subject: [PATCH 5/9] attempt to fix
---
.../config/GlobalExceptionHandler.java | 2 ++
.../model/request/RestaurantRequestTest.java | 4 ++--
.../RestaurantControllerIntTest.java | 6 +++---
.../controller/RestaurantControllerTest.java | 18 ++++++++---------
.../web/controller/SearchControllerTest.java | 20 +++++++++----------
httpClients/boot-rest-template/pom.xml | 2 +-
scheduler/boot-scheduler-quartz/pom.xml | 2 +-
7 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
index c3dae559f..42addf801 100644
--- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
+++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
@@ -3,6 +3,7 @@
import com.example.mongoes.web.exception.DuplicateRestaurantException;
import com.example.mongoes.web.exception.RestaurantNotFoundException;
import jakarta.validation.ConstraintViolationException;
+import java.net.URI;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
@@ -61,6 +62,7 @@ Mono handleConstraintViolation(ConstraintViolationException ex) {
ProblemDetail problemDetail =
ProblemDetail.forStatusAndDetail(HttpStatusCode.valueOf(400), "Validation failed");
problemDetail.setTitle("Constraint Violation");
+ problemDetail.setType(URI.create("https://api.mongoes.com/errors/validation-error"));
List validationErrorsList =
ex.getConstraintViolations().stream()
.map(
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
index 7900121d7..99beed82d 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/model/request/RestaurantRequestTest.java
@@ -13,10 +13,10 @@
import org.springframework.boot.test.json.JsonContent;
import org.springframework.context.annotation.Import;
import org.springframework.data.geo.Point;
-import org.springframework.data.web.config.SpringDataJacksonConfiguration;
+import org.springframework.data.web.config.SpringDataJackson3Configuration;
@JsonTest
-@Import(SpringDataJacksonConfiguration.class)
+@Import(SpringDataJackson3Configuration.class)
class RestaurantRequestTest {
@Autowired private JacksonTester jacksonTester;
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
index bd96d32d1..82803cdd4 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
@@ -72,7 +72,7 @@ void createRestaurant_WithDuplicateName_ShouldReturnConflict() {
.json(
"""
{
- "type":"about:blank",
+ "type":"https://api.mongoes.com/errors/validation-error",
"title":"Conflict",
"status":409,
"detail":"Restaurant with name 'Restaurant2' already exists",
@@ -243,7 +243,7 @@ void findRestaurantById_WithNonExistentId_ShouldReturnNotFound() {
.json(
"""
{
- "type":"about:blank",
+ "type":"https://api.mongoes.com/errors/validation-error",
"title":"Not Found",
"status":404,
"detail":"Restaurant not found with id: 999999",
@@ -265,7 +265,7 @@ void findRestaurantByName_WithNonExistentName_ShouldReturnNotFound() {
.json(
"""
{
- "type":"about:blank",
+ "type":"https://api.mongoes.com/errors/validation-error",
"title":"Not Found",
"status":404,
"detail":"Restaurant not found with name: Non Existent Restaurant",
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
index c7fa0fdca..d8e064cc0 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
@@ -79,7 +79,7 @@ void findAllRestaurants_WithInvalidLimit_ShouldReturnBadRequest() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Constraint Violation",
"status": 400,
"detail": "Validation failed",
@@ -114,7 +114,7 @@ void whenRestaurantRequestWithNullName_thenBadRequest() {
.expectBody()
.json(
"""
- {"type":"about:blank","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
+ {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
""");
}
@@ -136,7 +136,7 @@ void whenRestaurantRequestWithEmptyBorough_thenBadRequest() {
.expectBody()
.json(
"""
- {"type":"about:blank","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
+ {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
""");
}
@@ -180,7 +180,7 @@ void whenInvalidGrade_willReturns400() {
.expectBody()
.json(
"""
- {"type":"about:blank","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
+ {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
""");
}
@@ -204,7 +204,7 @@ void whenNegativeScore_willReturns400() {
.expectBody()
.json(
"""
- {"type":"about:blank","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
+ {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
""");
}
@@ -281,7 +281,7 @@ void findRestaurantByName_WithTooLongName_ShouldReturnBadRequest() {
.expectBody()
.json(
"""
- {"type":"about:blank","title":"Constraint Violation","status":400,"detail":"Validation failed","instance":"/api/restaurant/name/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","violations":[{"object":"RestaurantController","field":"findRestaurantByName.restaurantName","rejectedValue":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","message":"size must be between 0 and 255"}]}
+ {"type":"https://api.mongoes.com/errors/validation-error","title":"Constraint Violation","status":400,"detail":"Validation failed","instance":"/api/restaurant/name/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","violations":[{"object":"RestaurantController","field":"findRestaurantByName.restaurantName","rejectedValue":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","message":"size must be between 0 and 255"}]}
""");
}
@@ -316,7 +316,7 @@ void findRestaurantByName_WithInvalidCharacters_ShouldReturnBadRequest(
.isBadRequest()
.expectBody()
.jsonPath("$.type")
- .isEqualTo("about:blank")
+ .isEqualTo("https://api.mongoes.com/errors/validation-error")
.jsonPath("$.title")
.isEqualTo("Constraint Violation")
.jsonPath("$.status")
@@ -451,7 +451,7 @@ void createRestaurant_WithInvalidRequest_ShouldReturnBadRequest() {
.expectBody()
.json(
"""
- {"type":"about:blank","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
+ {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
""");
}
@@ -493,7 +493,7 @@ void updateGradesOfRestaurant_WithInvalidRequest_ShouldReturnBadRequest() {
.expectBody()
.json(
"""
- {"type":"about:blank","title":"Constraint Violation","status":400,"detail":"Validation failed","instance":"/api/restaurant/1/grades","violations":[{"object":"RestaurantController","field":"updateGradesOfRestaurant.grades[0].date","rejectedValue":null,"message":"Date cannot be null"},{"object":"RestaurantController","field":"updateGradesOfRestaurant.grades[0].grade","rejectedValue":null,"message":"Grade cannot be blank"},{"object":"RestaurantController","field":"updateGradesOfRestaurant.grades[0].score","rejectedValue":null,"message":"Score cannot be null"}]}
+ {"type":"https://api.mongoes.com/errors/validation-error","title":"Constraint Violation","status":400,"detail":"Validation failed","instance":"/api/restaurant/1/grades","violations":[{"object":"RestaurantController","field":"updateGradesOfRestaurant.grades[0].date","rejectedValue":null,"message":"Date cannot be null"},{"object":"RestaurantController","field":"updateGradesOfRestaurant.grades[0].grade","rejectedValue":null,"message":"Grade cannot be blank"},{"object":"RestaurantController","field":"updateGradesOfRestaurant.grades[0].score","rejectedValue":null,"message":"Score cannot be null"}]}
""");
}
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
index 9f2929887..386107a43 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/SearchControllerTest.java
@@ -310,7 +310,7 @@ class CoordinateValidationTests {
private static final String MISSING_PARAMETER_ERROR_JSON =
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Bad Request",
"status": 400,
"detail": "Required query parameter '%s' is not present.",
@@ -348,7 +348,7 @@ void whenCoordinatesOutOfRange_thenReturns400(
.isBadRequest()
.expectBody()
.jsonPath("$.type")
- .isEqualTo("about:blank")
+ .isEqualTo("https://api.mongoes.com/errors/validation-error")
.jsonPath("$.title")
.isEqualTo("Constraint Violation")
.jsonPath("$.status")
@@ -432,7 +432,7 @@ void whenDistanceMissing_thenReturns400() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Bad Request",
"status": 400,
"detail": "Required query parameter 'distance' is not present.",
@@ -462,7 +462,7 @@ void whenDistanceNegative_thenReturns400() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Constraint Violation",
"status": 400,
"detail": "Validation failed",
@@ -709,7 +709,7 @@ void searchRestaurantIdRange_WithNullLowerLimit_ShouldReturnBadRequest() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Bad Request",
"status": 400,
"detail": "Required query parameter 'lowerLimit' is not present.",
@@ -735,7 +735,7 @@ void searchRestaurantIdRange_WithNullUpperLimit_ShouldReturnBadRequest() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Bad Request",
"status": 400,
"detail": "Required query parameter 'upperLimit' is not present.",
@@ -762,7 +762,7 @@ void searchRestaurantIdRange_WithZeroLowerLimit_ShouldReturnBadRequest() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Constraint Violation",
"status": 400,
"detail": "Validation failed",
@@ -797,7 +797,7 @@ void searchRestaurantIdRange_WithZeroUpperLimit_ShouldReturnBadRequest() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Constraint Violation",
"status": 400,
"detail": "Validation failed",
@@ -832,7 +832,7 @@ void searchRestaurantIdRange_WithNegativeLowerLimit_ShouldReturnBadRequest() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Constraint Violation",
"status": 400,
"detail": "Validation failed",
@@ -867,7 +867,7 @@ void searchRestaurantIdRange_WithNegativeUpperLimit_ShouldReturnBadRequest() {
.json(
"""
{
- "type": "about:blank",
+ "type": "https://api.mongoes.com/errors/validation-error",
"title": "Constraint Violation",
"status": 400,
"detail": "Validation failed",
diff --git a/httpClients/boot-rest-template/pom.xml b/httpClients/boot-rest-template/pom.xml
index aacd96159..b0b085373 100644
--- a/httpClients/boot-rest-template/pom.xml
+++ b/httpClients/boot-rest-template/pom.xml
@@ -5,7 +5,7 @@
org.springframework.boot
spring-boot-starter-parent
- 4.0.0
+ 4.0.0-RC2
com.example.rest.template
diff --git a/scheduler/boot-scheduler-quartz/pom.xml b/scheduler/boot-scheduler-quartz/pom.xml
index 19c93a9a0..b6233e075 100644
--- a/scheduler/boot-scheduler-quartz/pom.xml
+++ b/scheduler/boot-scheduler-quartz/pom.xml
@@ -7,7 +7,7 @@
org.springframework.boot
spring-boot-starter-parent
- 4.0.0
+ 4.0.0-RC1
com.scheduler.quartz
From 9bf3a45e6585a87a423b3ffb57306eb59af79ddf Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 17:36:26 +0000
Subject: [PATCH 6/9] fix : normal tests
---
.../config/GlobalExceptionHandler.java | 31 ++++++++++++++-----
.../controller/RestaurantControllerTest.java | 10 +++---
2 files changed, 28 insertions(+), 13 deletions(-)
diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
index 42addf801..f3914ca09 100644
--- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
+++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
@@ -7,37 +7,44 @@
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
-import org.springframework.http.HttpStatusCode;
+import org.jspecify.annotations.NonNull;
+import org.springframework.core.Ordered;
+import org.springframework.core.annotation.Order;
+import org.springframework.http.HttpStatus;
import org.springframework.http.ProblemDetail;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.bind.support.WebExchangeBindException;
+import org.springframework.web.server.MissingRequestValueException;
import reactor.core.publisher.Mono;
@RestControllerAdvice
+@Order(Ordered.HIGHEST_PRECEDENCE)
public class GlobalExceptionHandler {
@ExceptionHandler(DuplicateRestaurantException.class)
- public Mono handleDuplicateRestaurantException(DuplicateRestaurantException ex) {
+ public Mono<@NonNull ProblemDetail> handleDuplicateRestaurantException(
+ DuplicateRestaurantException ex) {
ProblemDetail problemDetail =
ProblemDetail.forStatusAndDetail(ex.getHttpStatus(), ex.getMessage());
return Mono.just(problemDetail);
}
@ExceptionHandler(RestaurantNotFoundException.class)
- Mono handleRestaurantNotFoundException(RestaurantNotFoundException ex) {
+ Mono<@NonNull ProblemDetail> handleRestaurantNotFoundException(RestaurantNotFoundException ex) {
ProblemDetail problemDetail =
ProblemDetail.forStatusAndDetail(ex.getHttpStatus(), ex.getMessage());
return Mono.just(problemDetail);
}
@ExceptionHandler(WebExchangeBindException.class)
- Mono handleValidationErrors(WebExchangeBindException ex) {
+ Mono<@NonNull ProblemDetail> handleValidationErrors(WebExchangeBindException ex) {
ProblemDetail problemDetail =
ProblemDetail.forStatusAndDetail(
- HttpStatusCode.valueOf(400), "Request failed validation checks.");
- problemDetail.setTitle("Constraint Violation");
+ HttpStatus.BAD_REQUEST, "Invalid request content.");
+ problemDetail.setTitle("Bad Request");
+ problemDetail.setType(URI.create("https://api.mongoes.com/errors/validation-error"));
List validationErrorsList =
ex.getAllErrors().stream()
.map(
@@ -57,10 +64,10 @@ Mono handleValidationErrors(WebExchangeBindException ex) {
}
@ExceptionHandler(ConstraintViolationException.class)
- Mono handleConstraintViolation(ConstraintViolationException ex) {
+ Mono<@NonNull ProblemDetail> handleConstraintViolation(ConstraintViolationException ex) {
ProblemDetail problemDetail =
- ProblemDetail.forStatusAndDetail(HttpStatusCode.valueOf(400), "Validation failed");
+ ProblemDetail.forStatusAndDetail(HttpStatus.BAD_REQUEST, "Validation failed");
problemDetail.setTitle("Constraint Violation");
problemDetail.setType(URI.create("https://api.mongoes.com/errors/validation-error"));
List validationErrorsList =
@@ -78,5 +85,13 @@ Mono handleConstraintViolation(ConstraintViolationException ex) {
return Mono.just(problemDetail);
}
+ @ExceptionHandler(MissingRequestValueException.class)
+ Mono<@NonNull ProblemDetail> handleException(MissingRequestValueException ex) {
+ ProblemDetail problemDetail =
+ ProblemDetail.forStatusAndDetail(ex.getStatusCode(), ex.getBody().getDetail());
+ problemDetail.setType(URI.create("https://api.mongoes.com/errors/validation-error"));
+ return Mono.just(problemDetail);
+ }
+
record ApiValidationError(String object, String field, Object rejectedValue, String message) {}
}
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
index d8e064cc0..f8697a8b0 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerTest.java
@@ -114,7 +114,7 @@ void whenRestaurantRequestWithNullName_thenBadRequest() {
.expectBody()
.json(
"""
- {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
+ {"type":"https://api.mongoes.com/errors/validation-error","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
""");
}
@@ -136,7 +136,7 @@ void whenRestaurantRequestWithEmptyBorough_thenBadRequest() {
.expectBody()
.json(
"""
- {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
+ {"type":"https://api.mongoes.com/errors/validation-error","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
""");
}
@@ -180,7 +180,7 @@ void whenInvalidGrade_willReturns400() {
.expectBody()
.json(
"""
- {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
+ {"type":"https://api.mongoes.com/errors/validation-error","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
""");
}
@@ -204,7 +204,7 @@ void whenNegativeScore_willReturns400() {
.expectBody()
.json(
"""
- {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
+ {"type":"https://api.mongoes.com/errors/validation-error","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant/1/grade"}
""");
}
@@ -451,7 +451,7 @@ void createRestaurant_WithInvalidRequest_ShouldReturnBadRequest() {
.expectBody()
.json(
"""
- {"title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
+ {"type":"https://api.mongoes.com/errors/validation-error","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/api/restaurant"}
""");
}
From ac6a389d2790a1f8d23eb250fa8f7d4dcda932b7 Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 17:53:27 +0000
Subject: [PATCH 7/9] attempt to fix
---
.../com/example/mongoes/config/WebFluxConfig.java | 15 ++++++++-------
scheduler/boot-scheduler-quartz/pom.xml | 7 ++++++-
.../src/main/resources/application.properties | 2 +-
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/WebFluxConfig.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/WebFluxConfig.java
index d57785cf1..ef0986567 100644
--- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/WebFluxConfig.java
+++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/WebFluxConfig.java
@@ -1,8 +1,9 @@
package com.example.mongoes.config;
+import org.jspecify.annotations.NonNull;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.data.geo.GeoModule;
+import org.springframework.data.geo.GeoJacksonModule;
import org.springframework.web.reactive.config.CorsRegistry;
import org.springframework.web.reactive.config.WebFluxConfigurer;
@@ -16,16 +17,16 @@ public WebFluxConfig(ApplicationProperties properties) {
}
@Override
- public void addCorsMappings(CorsRegistry registry) {
+ public void addCorsMappings(@NonNull CorsRegistry registry) {
registry.addMapping(properties.getCors().getPathPattern())
- .allowedMethods(properties.getCors().getAllowedMethods())
- .allowedHeaders(properties.getCors().getAllowedHeaders())
- .allowedOriginPatterns(properties.getCors().getAllowedOriginPatterns())
+ .allowedMethods(properties.getCors().getAllowedMethods().split(","))
+ .allowedHeaders(properties.getCors().getAllowedHeaders().split(","))
+ .allowedOriginPatterns(properties.getCors().getAllowedOriginPatterns().split(","))
.allowCredentials(properties.getCors().isAllowCredentials());
}
@Bean
- GeoModule jacksonGeoModule() {
- return new GeoModule();
+ GeoJacksonModule geoJacksonModule() {
+ return new GeoJacksonModule();
}
}
diff --git a/scheduler/boot-scheduler-quartz/pom.xml b/scheduler/boot-scheduler-quartz/pom.xml
index b6233e075..915ae0e39 100644
--- a/scheduler/boot-scheduler-quartz/pom.xml
+++ b/scheduler/boot-scheduler-quartz/pom.xml
@@ -7,7 +7,7 @@
org.springframework.boot
spring-boot-starter-parent
- 4.0.0-RC1
+ 4.0.0
com.scheduler.quartz
@@ -111,6 +111,11 @@
org.springframework.boot
spring-boot-starter-webmvc-test
test
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator-test
+ test
org.springframework.boot
diff --git a/scheduler/boot-scheduler-quartz/src/main/resources/application.properties b/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
index 27c2e1d03..525484f5b 100644
--- a/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
+++ b/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
@@ -9,7 +9,7 @@ spring.threads.virtual.enabled=true
################ Actuator #####################
management.endpoints.web.exposure.include=configprops,env,health,info,logfile,loggers,metrics,prometheus,quartz
management.endpoint.health.show-details=always
-management.endpoint.quartz.access=read-only
+management.endpoint.quartz.access=UNRESTRICTED
################ Database #####################
spring.jpa.show-sql=false
From 1522cc8701fd2d4aef488fa5b96d717e463ac893 Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 17:59:56 +0000
Subject: [PATCH 8/9] fix : failures
---
boot-mongodb-elasticsearch/README.md | 4 ++--
.../com/example/mongoes/config/GlobalExceptionHandler.java | 2 ++
.../mongoes/web/controller/RestaurantControllerIntTest.java | 6 +++---
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/boot-mongodb-elasticsearch/README.md b/boot-mongodb-elasticsearch/README.md
index fd6ce68a4..3e39226e1 100644
--- a/boot-mongodb-elasticsearch/README.md
+++ b/boot-mongodb-elasticsearch/README.md
@@ -158,8 +158,8 @@ docker compose -f docker/docker-compose.yml up -d
## Configuration Properties
Key application properties:
```properties
-spring.data.mongodb.database=mongoes
-spring.data.mongodb.uri=mongodb://localhost:27017/mongoes?replicaSet=rs0
+spring.mongodb.database=mongoes
+spring.mongodb.uri=mongodb://localhost:27017/mongoes?replicaSet=rs0&readPreference=primary&directConnection=true
spring.elasticsearch.uris=localhost:9200
spring.elasticsearch.socket-timeout=10s
```
diff --git a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
index f3914ca09..68380e7c9 100644
--- a/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
+++ b/boot-mongodb-elasticsearch/src/main/java/com/example/mongoes/config/GlobalExceptionHandler.java
@@ -28,6 +28,7 @@ public class GlobalExceptionHandler {
DuplicateRestaurantException ex) {
ProblemDetail problemDetail =
ProblemDetail.forStatusAndDetail(ex.getHttpStatus(), ex.getMessage());
+ problemDetail.setType(URI.create("https://api.mongoes.com/errors/duplicate-restaurant"));
return Mono.just(problemDetail);
}
@@ -35,6 +36,7 @@ public class GlobalExceptionHandler {
Mono<@NonNull ProblemDetail> handleRestaurantNotFoundException(RestaurantNotFoundException ex) {
ProblemDetail problemDetail =
ProblemDetail.forStatusAndDetail(ex.getHttpStatus(), ex.getMessage());
+ problemDetail.setType(URI.create("https://api.mongoes.com/errors/restaurant-not-found"));
return Mono.just(problemDetail);
}
diff --git a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
index 82803cdd4..8f19cecbc 100644
--- a/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
+++ b/boot-mongodb-elasticsearch/src/test/java/com/example/mongoes/web/controller/RestaurantControllerIntTest.java
@@ -72,7 +72,7 @@ void createRestaurant_WithDuplicateName_ShouldReturnConflict() {
.json(
"""
{
- "type":"https://api.mongoes.com/errors/validation-error",
+ "type":"https://api.mongoes.com/errors/duplicate-restaurant",
"title":"Conflict",
"status":409,
"detail":"Restaurant with name 'Restaurant2' already exists",
@@ -243,7 +243,7 @@ void findRestaurantById_WithNonExistentId_ShouldReturnNotFound() {
.json(
"""
{
- "type":"https://api.mongoes.com/errors/validation-error",
+ "type":"https://api.mongoes.com/errors/restaurant-not-found",
"title":"Not Found",
"status":404,
"detail":"Restaurant not found with id: 999999",
@@ -265,7 +265,7 @@ void findRestaurantByName_WithNonExistentName_ShouldReturnNotFound() {
.json(
"""
{
- "type":"https://api.mongoes.com/errors/validation-error",
+ "type":"https://api.mongoes.com/errors/restaurant-not-found",
"title":"Not Found",
"status":404,
"detail":"Restaurant not found with name: Non Existent Restaurant",
From 9c0b99255f6f7e85b2edd5ced664728f4135ac53 Mon Sep 17 00:00:00 2001
From: Raja Kolli
Date: Sun, 23 Nov 2025 18:02:47 +0000
Subject: [PATCH 9/9] revert
---
scheduler/boot-scheduler-quartz/pom.xml | 2 +-
.../src/main/resources/application.properties | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scheduler/boot-scheduler-quartz/pom.xml b/scheduler/boot-scheduler-quartz/pom.xml
index 915ae0e39..2e07dc570 100644
--- a/scheduler/boot-scheduler-quartz/pom.xml
+++ b/scheduler/boot-scheduler-quartz/pom.xml
@@ -7,7 +7,7 @@
org.springframework.boot
spring-boot-starter-parent
- 4.0.0
+ 4.0.0-RC1
com.scheduler.quartz
diff --git a/scheduler/boot-scheduler-quartz/src/main/resources/application.properties b/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
index 525484f5b..352147acb 100644
--- a/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
+++ b/scheduler/boot-scheduler-quartz/src/main/resources/application.properties
@@ -9,7 +9,7 @@ spring.threads.virtual.enabled=true
################ Actuator #####################
management.endpoints.web.exposure.include=configprops,env,health,info,logfile,loggers,metrics,prometheus,quartz
management.endpoint.health.show-details=always
-management.endpoint.quartz.access=UNRESTRICTED
+management.endpoint.quartz.enabled=true
################ Database #####################
spring.jpa.show-sql=false