diff options
author | m.kowalski3 <m.kowalski3@partner.samsung.com> | 2020-05-12 09:52:25 +0200 |
---|---|---|
committer | m.kowalski3 <m.kowalski3@partner.samsung.com> | 2020-05-18 10:00:49 +0200 |
commit | 5bcfb3efb9b6e5a58e88144c679a52b080612414 (patch) | |
tree | 07d33f09f91caebfa8359d2701e13da5375c29db /security-util-lib/src | |
parent | 468c7be3774c565ffe531d164ff7864135cf5a57 (diff) |
Add unit test for EcompLoggerErrorCode
Issue-ID: SDC-2327
Signed-off-by: Marcin Kowalski <m.kowalski3@partner.samsung.com>
Change-Id: I38ea3b9d037a4fca633333a26c105df87f511bd4
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); + + } + + +} |