From 1fa483a5998c4196c5034d0c700b519f87604308 Mon Sep 17 00:00:00 2001 From: Oleg Ryazancev Date: Fri, 22 Mar 2024 16:17:52 +0300 Subject: [PATCH] Fix checkstyle issues --- .../util/exception/custom/UnauthorizedException.java | 4 ++-- .../util/exception/custom/ConfirmationTokenException.java | 2 +- common/src/main/java/com/ryazancev/common/dto/Element.java | 2 +- .../ryazancev/logo/util/exception/CustomExceptionFactory.java | 2 +- logo/src/main/resources/messages/messages.properties | 2 +- .../notification/util/exception/CustomErrorCode.java | 4 ++-- .../organization/util/exception/CustomErrorCode.java | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api-gateway/src/main/java/com/ryazancev/apigateway/util/exception/custom/UnauthorizedException.java b/api-gateway/src/main/java/com/ryazancev/apigateway/util/exception/custom/UnauthorizedException.java index 029f4c4..1699d39 100644 --- a/api-gateway/src/main/java/com/ryazancev/apigateway/util/exception/custom/UnauthorizedException.java +++ b/api-gateway/src/main/java/com/ryazancev/apigateway/util/exception/custom/UnauthorizedException.java @@ -36,7 +36,7 @@ public UnauthorizedException unauthorized() { ); } - public UnauthorizedException unauthorizedRequest(){ + public UnauthorizedException unauthorizedRequest() { return new UnauthorizedException( CustomErrorCode.OS_API_GATEWAY_102_401.getMessage(), @@ -44,7 +44,7 @@ public UnauthorizedException unauthorizedRequest(){ ); } - public UnauthorizedException insufficientPrivileges(){ + public UnauthorizedException insufficientPrivileges() { return new UnauthorizedException( CustomErrorCode.OS_API_GATEWAY_103_401.getMessage(), diff --git a/auth/src/main/java/com/ryazancev/auth/util/exception/custom/ConfirmationTokenException.java b/auth/src/main/java/com/ryazancev/auth/util/exception/custom/ConfirmationTokenException.java index b7cfe37..81cb7da 100644 --- a/auth/src/main/java/com/ryazancev/auth/util/exception/custom/ConfirmationTokenException.java +++ b/auth/src/main/java/com/ryazancev/auth/util/exception/custom/ConfirmationTokenException.java @@ -37,7 +37,7 @@ public ConfirmationTokenException emailConfirmed() { ); } - public ConfirmationTokenException notFound(){ + public ConfirmationTokenException notFound() { return new ConfirmationTokenException( CustomErrorCode.OS_AUTH_203_404.getMessage(), diff --git a/common/src/main/java/com/ryazancev/common/dto/Element.java b/common/src/main/java/com/ryazancev/common/dto/Element.java index cc1f29b..0f30840 100644 --- a/common/src/main/java/com/ryazancev/common/dto/Element.java +++ b/common/src/main/java/com/ryazancev/common/dto/Element.java @@ -47,7 +47,7 @@ default T safelyCast(Class targetType, boolean throwException) { if (throwException) { throw new ServiceUnavailableException( ((Fallback) this).getMessage(), - HttpStatus.SERVICE_UNAVAILABLE); + HttpStatus.SERVICE_UNAVAILABLE.name()); } else { String message = "SERVICE_UNAVAILABLE"; diff --git a/logo/src/main/java/com/ryazancev/logo/util/exception/CustomExceptionFactory.java b/logo/src/main/java/com/ryazancev/logo/util/exception/CustomExceptionFactory.java index 51dff08..55b921b 100644 --- a/logo/src/main/java/com/ryazancev/logo/util/exception/CustomExceptionFactory.java +++ b/logo/src/main/java/com/ryazancev/logo/util/exception/CustomExceptionFactory.java @@ -8,7 +8,7 @@ public class CustomExceptionFactory { - public static LogoUploadException getLogoUpload(){ + public static LogoUploadException getLogoUpload() { return new LogoUploadException(); } diff --git a/logo/src/main/resources/messages/messages.properties b/logo/src/main/resources/messages/messages.properties index 5f1ca68..2987519 100644 --- a/logo/src/main/resources/messages/messages.properties +++ b/logo/src/main/resources/messages/messages.properties @@ -1,3 +1,3 @@ OS-LOGO-101-400=Logo upload failed: {0} OS-LOGO-102-400=Logo must have name -OS-LOGO-INTERNAL-500=Internal: {0} \ No newline at end of file +OS-LOGO-INTERNAL-500=Internal: {0} diff --git a/notification/src/main/java/com/ryazancev/notification/util/exception/CustomErrorCode.java b/notification/src/main/java/com/ryazancev/notification/util/exception/CustomErrorCode.java index 539caf3..bd0e72d 100644 --- a/notification/src/main/java/com/ryazancev/notification/util/exception/CustomErrorCode.java +++ b/notification/src/main/java/com/ryazancev/notification/util/exception/CustomErrorCode.java @@ -12,8 +12,8 @@ public enum CustomErrorCode { OS_NOTIFICATION_101_404("OS-NOTIFICATION-101-404"), OS_NOTIFICATION_201_400("OS-NOTIFICATION-201-400"), - OS_NOTIFICATION_SERVICE_UNAVAILABLE_503 - ("OS-NOTIFICATION-SERVICE_UNAVAILABLE-503"), + OS_NOTIFICATION_SERVICE_UNAVAILABLE_503( + "OS-NOTIFICATION-SERVICE_UNAVAILABLE-503"), OS_NOTIFICATION_INTERNAL_500("OS-NOTIFICATION-INTERNAL-500"); @Setter diff --git a/organization/src/main/java/com/ryazancev/organization/util/exception/CustomErrorCode.java b/organization/src/main/java/com/ryazancev/organization/util/exception/CustomErrorCode.java index 2f97c01..b7d28b7 100644 --- a/organization/src/main/java/com/ryazancev/organization/util/exception/CustomErrorCode.java +++ b/organization/src/main/java/com/ryazancev/organization/util/exception/CustomErrorCode.java @@ -17,8 +17,8 @@ public enum CustomErrorCode { OS_ORGANIZATION_201_400("OS-ORGANIZATION-201-400"), OS_ORGANIZATION_202_400("OS-ORGANIZATION-202-400"), OS_ORGANIZATION_301_404("OS-ORGANIZATION-301-404"), - OS_ORGANIZATION_SERVICE_UNAVAILABLE_503 - ("OS-ORGANIZATION-SERVICE_UNAVAILABLE-503"), + OS_ORGANIZATION_SERVICE_UNAVAILABLE_503( + "OS-ORGANIZATION-SERVICE_UNAVAILABLE-503"), OS_ORGANIZATION_SECURITY("OS-ORGANIZATION-SECURITY"), OS_ORGANIZATION_INTERNAL_500("OS-ORGANIZATION-INTERNAL-500");