From cfb9b5f1cfe7d5c319312d8d067ae4c2a8d8d93c Mon Sep 17 00:00:00 2001 From: mmis Date: Fri, 23 Feb 2018 11:32:19 +0000 Subject: Added junit tests in ONAP-Logging Added junit tests to org.onap.policy.common.logging.eelf package in ONAP-Logging Issue-ID: POLICY-582 Change-Id: Ifca9c38d8b8703b183c25d891d6ed257eb21c91b Signed-off-by: mmis --- .../onap/policy/common/logging/eelf/ErrorCodeMap.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java') diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java index 4df86a4d..845c5caf 100644 --- a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java +++ b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/ErrorCodeMap.java @@ -28,9 +28,8 @@ import java.util.EnumMap; * */ public class ErrorCodeMap { - - protected static final EnumMap hm = new EnumMap<>(MessageCodes.class); + private static final EnumMap hm = new EnumMap<>(MessageCodes.class); private static final String ERROR_PERMISSIONS = "POLICY-100E"; private static final String ERROR_PERMISSIONS_DESCRIPTION = "This is a Permissions Error. Please check the error message for detail information"; @@ -79,7 +78,12 @@ public class ErrorCodeMap { hm.put(MessageCodes.ERROR_UNKNOWN, new ErrorCodeInfo(ERROR_UNKNOWN, ERROR_UNKNOWN_DESCRIPTION)); hm.put(MessageCodes.ERROR_AUDIT, new ErrorCodeInfo(ERROR_AUDIT, ERROR_AUDIT_DESCRIPTION)); } - private ErrorCodeMap() {}; + private ErrorCodeMap() {} + + public static ErrorCodeInfo getErrorCodeInfo(MessageCodes messageCode) { + return hm.get(messageCode); + } + static class ErrorCodeInfo { private String errorCode; @@ -94,17 +98,9 @@ public class ErrorCodeMap { return errorCode; } - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - public String getErrorDesc() { return errorDesc; } - - public void setErrorDesc(String errorDesc) { - this.errorDesc = errorDesc; - } } -- cgit 1.2.3-korg