aboutsummaryrefslogtreecommitdiffstats
path: root/appc-dg
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-08-20 16:16:29 +0530
committerTakamune Cho <tc012c@att.com>2018-08-20 23:27:24 +0000
commit89e8b994334df1611c21a77eaf084ac8f3e038bb (patch)
treee3c6bbc87c4a73a611fdbbf692b96568b74777ab /appc-dg
parentc1d1ea317ddc7f70bcbe63dba0786687f678830a (diff)
removed try catch from test case & formatted code
replaced try catch with @Test(expected=JAXBException.class) Issue-ID: APPC-1086 Change-Id: Ie3ec5a60b4ac09797ce2a8e5ed2f79b2979875c1 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'appc-dg')
-rw-r--r--appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JAXBUtilTest.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JAXBUtilTest.java b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JAXBUtilTest.java
index f0e525b53..b5adc5d3f 100644
--- a/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JAXBUtilTest.java
+++ b/appc-dg/appc-dg-shared/appc-dg-common/src/test/java/org/onap/appc/dg/common/utils/JAXBUtilTest.java
@@ -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
@@ -19,30 +21,17 @@
*/
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);
- }
}
}