From: Sandeep J Date: Mon, 20 Aug 2018 10:46:29 +0000 (+0530) Subject: removed try catch from test case & formatted code X-Git-Tag: 1.4.0~75 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=89e8b994334df1611c21a77eaf084ac8f3e038bb;hp=c1d1ea317ddc7f70bcbe63dba0786687f678830a;p=appc.git 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 --- 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 = "I1T1"; + JAXBUtil.toObject(xmlStr, JSONUtilVnfTest.class); - @Before - public void setUp() { - } - - @Test - public void testToObjectFail() { - String xmlStr = "I1T1"; - JSONUtilVnfTest jOut = null; - try { - jOut = JAXBUtil.toObject(xmlStr, JSONUtilVnfTest.class); - } catch (JAXBException jaxbe) { - assertEquals(jOut, null); - } } }