aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java')
-rw-r--r--src/test/java/org/onap/dcae/vestest/TestCustomExceptionLoader.java74
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]);
+ }
+ }
}