From 13c0ed7ea05b03f555532f1b4f81b577c0a5d8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0dil=20Zeynep=20Alemdar?= Date: Mon, 13 Jan 2025 10:41:58 +0300 Subject: [PATCH] AYS-567 | Refactor method_not_allowed response message to be API_ERROR (#430) --- .../ays/common/exception/handler/GlobalExceptionHandler.java | 2 +- .../common/exception/handler/GlobalExceptionHandlerTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/ays/common/exception/handler/GlobalExceptionHandler.java b/src/main/java/org/ays/common/exception/handler/GlobalExceptionHandler.java index 290373256..bb870adf9 100644 --- a/src/main/java/org/ays/common/exception/handler/GlobalExceptionHandler.java +++ b/src/main/java/org/ays/common/exception/handler/GlobalExceptionHandler.java @@ -179,7 +179,7 @@ AysErrorResponse handleHttpRequestMethodNotSupportedException(HttpRequestMethodN log.error(exception.getMessage(), exception); return AysErrorResponse.builder() - .header(AysErrorResponse.Header.VALIDATION_ERROR.getName()) + .header(AysErrorResponse.Header.API_ERROR.getName()) .build(); } diff --git a/src/test/java/org/ays/common/exception/handler/GlobalExceptionHandlerTest.java b/src/test/java/org/ays/common/exception/handler/GlobalExceptionHandlerTest.java index 797a28028..b16e29c03 100644 --- a/src/test/java/org/ays/common/exception/handler/GlobalExceptionHandlerTest.java +++ b/src/test/java/org/ays/common/exception/handler/GlobalExceptionHandlerTest.java @@ -258,7 +258,7 @@ void givenUnsupportedHttpMethod_whenThrowHttpRequestMethodNotSupportedException_ // When AysErrorResponse mockErrorResponse = AysErrorResponse.builder() - .header(AysErrorResponse.Header.VALIDATION_ERROR.getName()) + .header(AysErrorResponse.Header.API_ERROR.getName()) .build(); // Then