diff options
author | Bharat saraswal <bharat.saraswal@huawei.com> | 2017-09-17 15:08:03 +0530 |
---|---|---|
committer | Bharat saraswal <bharat.saraswal@huawei.com> | 2017-09-17 09:45:45 +0000 |
commit | 96b5b53cbace0abfdc41f2cf0e20a4eb48f7fcdd (patch) | |
tree | 4b7d2da5aa4cc3ff22d64872f3f22b38720d9d5d /src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java | |
parent | 4e9e25c0bd99bd686648d7dd1dc64ad98c49f5b4 (diff) |
Fixing checkstyle errors
(followed:onap-java-style) removed redundant code.
Issue-Id:DCAEGEN2-92
Change-Id: Ie4741757f89357b31ce8968a6f7670db3014d528
Signed-off-by: Bharat saraswal <bharat.saraswal@huawei.com>
Diffstat (limited to 'src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java')
-rw-r--r-- | src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java b/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java index bf7dbda2..1cbd6c43 100644 --- a/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java +++ b/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java @@ -17,54 +17,56 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.dcae.vestest; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import com.att.nsa.drumlin.service.standards.HttpStatusCodes; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.onap.dcae.commonFunction.CommonStartup; import org.onap.dcae.commonFunction.CustomExceptionLoader; - -import com.att.nsa.drumlin.service.standards.HttpStatusCodes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class TestCustomExceptionLoader { - CustomExceptionLoader cl; - @Before - public void setUp() throws Exception { - cl = new CustomExceptionLoader(); - CommonStartup.exceptionConfig="./etc/ExceptionConfig.json"; - } + private static final Logger log = LoggerFactory.getLogger(TestCustomExceptionLoader.class); + private CustomExceptionLoader cl; + + @Before + public void setUp() throws Exception { + cl = new CustomExceptionLoader(); + CommonStartup.exceptionConfig = "./etc/ExceptionConfig.json"; + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testLoad() { + String op; + CustomExceptionLoader.LoadMap(); + op = "dataloaded"; + assertEquals("dataloaded", op); + } - @After - public void tearDown() throws Exception { - } + @Test + public void testLookup() { + String[] retarray; - @Test - public void testLoad() { - String op = "notloaded"; - CustomExceptionLoader.LoadMap(); - op = "dataloaded"; - assertEquals("dataloaded",op); - } - @Test - public void testLookup() { - String[] retarray = null; - - CommonStartup.exceptionConfig="./etc/ExceptionConfig.json"; - CustomExceptionLoader.LoadMap(); - retarray=CustomExceptionLoader.LookupMap(String.valueOf(HttpStatusCodes.k401_unauthorized), "Unauthorized user"); - if (retarray==null) - { - System.out.println("Lookup failed"); - } - else - { - assertEquals("\"POL2000\"",retarray[0].toString()); - } - - } + CommonStartup.exceptionConfig = "./etc/ExceptionConfig.json"; + CustomExceptionLoader.LoadMap(); + retarray = CustomExceptionLoader + .LookupMap(String.valueOf(HttpStatusCodes.k401_unauthorized), "Unauthorized user"); + if (retarray == null) { + log.info("Lookup failed"); + } else { + assertEquals("\"POL2000\"", retarray[0]); + } + } } |