X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fsal-netconf-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Fconnect%2Fnetconf%2FNetconfToNotificationTest.java;h=f2c85eade3e25c522239f53d26f2a90cb1c3250e;hb=e1bdc7d1eff9c117a0e3c4559f5e8a0595f53a3f;hp=732f86e691001291ad80d10d1a7f1cf3db90bf53;hpb=ad7c9979910bb02d97f2ebbd2703bbed0f22177f;p=netconf.git diff --git a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfToNotificationTest.java b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfToNotificationTest.java index 732f86e691..f2c85eade3 100644 --- a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfToNotificationTest.java +++ b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/NetconfToNotificationTest.java @@ -14,11 +14,9 @@ import static org.junit.Assert.assertTrue; import com.google.common.collect.Iterables; import java.io.InputStream; -import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; import java.util.Set; -import javax.xml.parsers.DocumentBuilderFactory; import org.junit.Before; import org.junit.Test; import org.opendaylight.controller.config.util.xml.XmlUtil; @@ -39,11 +37,8 @@ public class NetconfToNotificationTest { NetconfMessage userNotification; - @SuppressWarnings("deprecation") @Before public void setup() throws Exception { - final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); InputStream notifyPayloadStream = getClass().getResourceAsStream("/notification-payload.xml"); assertNotNull(notifyPayloadStream); @@ -52,7 +47,7 @@ public class NetconfToNotificationTest { userNotification = new NetconfMessage(doc); } - static SchemaContext getNotificationSchemaContext(Class loadClass, boolean getExceptionTest) throws Exception { + static SchemaContext getNotificationSchemaContext(final Class loadClass, final boolean getExceptionTest) throws Exception { final List modelsToParse = new ArrayList<>(); if (getExceptionTest) { @@ -86,7 +81,7 @@ public class NetconfToNotificationTest { assertNotNull(root); assertEquals(6, Iterables.size(root.getValue())); assertEquals("user-visited-page", root.getNodeType().getLocalName()); - assertEquals(new SimpleDateFormat(NetconfNotification.RFC3339_DATE_FORMAT_WITH_MILLIS_BLUEPRINT).parse("2015-10-23T09:42:27.67175+00:00"), + assertEquals(NetconfNotification.RFC3339_DATE_PARSER.apply("2015-10-23T09:42:27.67175+00:00"), ((DOMEvent) domNotification).getEventTime()); } }