removed try catch from test case & formatted code 63/61263/3
authorSandeep J <sandeejh@in.ibm.com>
Mon, 20 Aug 2018 10:46:29 +0000 (16:16 +0530)
committerTakamune Cho <tc012c@att.com>
Mon, 20 Aug 2018 23:27:24 +0000 (23:27 +0000)
replaced try catch with @Test(expected=JAXBException.class)

Issue-ID: APPC-1086
Change-Id: Ie3ec5a60b4ac09797ce2a8e5ed2f79b2979875c1
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JAXBUtilTest.java

index f0e525b..b5adc5d 100644 (file)
@@ -4,6 +4,8 @@
 * ================================================================================
 * Copyright 2018 AT&T
 *=================================================================================
+* Modifications Copyright 2018 AT&T
+*=================================================================================
 * 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
 */
 package org.onap.appc.dg.common.utils;
 
-import static org.junit.Assert.assertEquals;
+import javax.xml.bind.JAXBException;
 
-import org.junit.Before;
 import org.junit.Test;
 
-
-
-import javax.xml.bind.JAXBException;
-
 public class JAXBUtilTest {
+  
+    @Test(expected = JAXBException.class)
+    public void testToObjectFail() throws Exception {
+        String xmlStr = "<?xml version=\\\"1.0\\\"?><vnfId>I1</vnfId><vnfType>T1</vnfType>";
+        JAXBUtil.toObject(xmlStr, JSONUtilVnfTest.class);
 
-    @Before
-    public void setUp() {
-    }
-
-    @Test
-    public void testToObjectFail() {
-      String xmlStr = "<?xml version=\\\"1.0\\\"?><vnfId>I1</vnfId><vnfType>T1</vnfType>";
-      JSONUtilVnfTest jOut = null;
-        try {
-            jOut = JAXBUtil.toObject(xmlStr, JSONUtilVnfTest.class);
-        } catch (JAXBException jaxbe) {
-            assertEquals(jOut, null);
-        }
     }
 
 }