summaryrefslogtreecommitdiffstats
path: root/common-logging/src/test/java/org/onap/policy/common/logging/eelf/ErrorCodeMapTest.java
diff options
context:
space:
mode:
authormmis <michael.morris@ericsson.com>2018-02-23 11:32:19 +0000
committermmis <michael.morris@ericsson.com>2018-02-23 16:32:22 +0000
commitcfb9b5f1cfe7d5c319312d8d067ae4c2a8d8d93c (patch)
tree2336575dec468b49d8dcb34f4bf719c6b03a7566 /common-logging/src/test/java/org/onap/policy/common/logging/eelf/ErrorCodeMapTest.java
parent8de76c909737ba1b59526f96610f961f380ddc1f (diff)
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 <michael.morris@ericsson.com>
Diffstat (limited to 'common-logging/src/test/java/org/onap/policy/common/logging/eelf/ErrorCodeMapTest.java')
-rw-r--r--common-logging/src/test/java/org/onap/policy/common/logging/eelf/ErrorCodeMapTest.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/common-logging/src/test/java/org/onap/policy/common/logging/eelf/ErrorCodeMapTest.java b/common-logging/src/test/java/org/onap/policy/common/logging/eelf/ErrorCodeMapTest.java
new file mode 100644
index 00000000..ed4c879f
--- /dev/null
+++ b/common-logging/src/test/java/org/onap/policy/common/logging/eelf/ErrorCodeMapTest.java
@@ -0,0 +1,56 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP-Logging
+ * ================================================================================
+ * Copyright (C) 2018 Ericsson. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.policy.common.logging.eelf;
+
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.onap.policy.common.logging.eelf.ErrorCodeMap.ErrorCodeInfo;
+
+public class ErrorCodeMapTest {
+
+ @Test
+ public void testGetErrorCodeInfo() {
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.EXCEPTION_ERROR));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.GENERAL_ERROR));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.MISS_PROPERTY_ERROR));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.UPDATE_ERROR));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_SYSTEM_ERROR));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_DATA_ISSUE));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_PERMISSIONS));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_DATA_ISSUE));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_PROCESS_FLOW));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_SCHEMA_INVALID));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_UNKNOWN));
+ assertNotNull(ErrorCodeMap.getErrorCodeInfo(MessageCodes.ERROR_AUDIT));
+ }
+
+ @Test
+ public void testErrorCodeInfoGetErrorCode() {
+ ErrorCodeInfo errorCodeInfo = ErrorCodeMap.getErrorCodeInfo(MessageCodes.EXCEPTION_ERROR);
+ assertEquals("POLICY-503E", errorCodeInfo.getErrorCode());
+ }
+
+ @Test
+ public void testErrorCodeInfoGetErrorDesc() {
+ ErrorCodeInfo errorCodeInfo = ErrorCodeMap.getErrorCodeInfo(MessageCodes.EXCEPTION_ERROR);
+ assertEquals("This is an exception error message during the process. Please check the error message for detail information", errorCodeInfo.getErrorDesc());
+ }
+
+}