diff options
author | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-05-18 08:25:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-05-18 08:25:18 +0000 |
commit | 2f46ae18eea991bcf30d18ab1bb20a5f9b6fc1fd (patch) | |
tree | 975b63f97581eb60e655dda3496c5cae6b273bfd /security-util-lib/src | |
parent | 22869d7c767282af59e2df10d9041f4312b836d3 (diff) | |
parent | 5bcfb3efb9b6e5a58e88144c679a52b080612414 (diff) |
Merge "Add unit test for EcompLoggerErrorCode"
Diffstat (limited to 'security-util-lib/src')
-rw-r--r-- | security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java new file mode 100644 index 0000000..1bdbddf --- /dev/null +++ b/security-util-lib/src/test/java/org/onap/sdc/security/logging/enums/EcompLoggerErrorCodeTest.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2020 Samsung. 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.sdc.security.logging.enums; + +import org.junit.Assert; +import org.junit.Test; + +public class EcompLoggerErrorCodeTest { + + @Test + public void getByValueTest() { + + EcompLoggerErrorCode ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_0"); + Assert.assertEquals(ecompLoggerErrorCode.getErrorCode(), 0); + ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_100"); + Assert.assertEquals(ecompLoggerErrorCode.getErrorCode(), 100); + ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_200"); + Assert.assertEquals(ecompLoggerErrorCode.getErrorCode(), 200); + ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_300"); + Assert.assertEquals(ecompLoggerErrorCode.getErrorCode(), 300); + ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_400"); + Assert.assertEquals(ecompLoggerErrorCode.getErrorCode(), 400); + ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("E_500"); + Assert.assertEquals(ecompLoggerErrorCode.getErrorCode(), 500); + ecompLoggerErrorCode = EcompLoggerErrorCode.getByValue("none"); + Assert.assertEquals(ecompLoggerErrorCode.getErrorCode(), 900); + + } + + +} |