From 3d955b41d428d4d24cbf8c6380d96f3fa98eb9f7 Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Wed, 10 Jan 2024 07:20:50 +0000 Subject: [PATCH] feat : fix issue with exception handler --- .../configuration/GlobalExceptionHandler.java | 3 +++ .../multipledatasources/ApplicationIntegrationTest.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/jpa/boot-data-multipledatasources/src/main/java/com/example/multipledatasources/configuration/GlobalExceptionHandler.java b/jpa/boot-data-multipledatasources/src/main/java/com/example/multipledatasources/configuration/GlobalExceptionHandler.java index 4a95c9824..4f071019c 100644 --- a/jpa/boot-data-multipledatasources/src/main/java/com/example/multipledatasources/configuration/GlobalExceptionHandler.java +++ b/jpa/boot-data-multipledatasources/src/main/java/com/example/multipledatasources/configuration/GlobalExceptionHandler.java @@ -3,6 +3,8 @@ import java.util.Comparator; import java.util.List; import java.util.Objects; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.http.ProblemDetail; @@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.ResponseStatus; @ControllerAdvice +@Order(Ordered.HIGHEST_PRECEDENCE) public class GlobalExceptionHandler { @ExceptionHandler(MethodArgumentNotValidException.class) diff --git a/jpa/boot-data-multipledatasources/src/test/java/com/example/multipledatasources/ApplicationIntegrationTest.java b/jpa/boot-data-multipledatasources/src/test/java/com/example/multipledatasources/ApplicationIntegrationTest.java index da8dd253f..75dcd158e 100644 --- a/jpa/boot-data-multipledatasources/src/test/java/com/example/multipledatasources/ApplicationIntegrationTest.java +++ b/jpa/boot-data-multipledatasources/src/test/java/com/example/multipledatasources/ApplicationIntegrationTest.java @@ -28,7 +28,7 @@ class ApplicationIntegrationTest { @Container private static final PostgreSQLContainer POSTGRE_SQL_CONTAINER = - new PostgreSQLContainer<>("postgres:16.0-alpine"); + new PostgreSQLContainer<>("postgres:16.1-alpine"); @DynamicPropertySource static void registerDynamicProperties(DynamicPropertyRegistry registry) {