X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2FNetconfUtilTest.java;h=d85128067c7725acf9367dfe65871bc697cb8bf3;hb=refs%2Fchanges%2F13%2F23413%2F26;hp=b4b8aba81fc0513e5d7debf0aca749f1a592129b;hpb=a4bf6af96cc61e898b772c16527f676e9ba9c50a;p=controller.git diff --git a/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java index b4b8aba81f..d85128067c 100644 --- a/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java +++ b/opendaylight/netconf/netconf-util/src/test/java/org/opendaylight/controller/netconf/util/NetconfUtilTest.java @@ -7,15 +7,13 @@ */ package org.opendaylight.controller.netconf.util; -import org.junit.Test; -import org.opendaylight.controller.config.api.ConflictingVersionException; -import org.opendaylight.controller.netconf.api.NetconfMessage; -import org.opendaylight.controller.netconf.util.xml.XmlUtil; -import org.w3c.dom.Document; - +import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; -import static org.junit.matchers.JUnitMatchers.containsString; + +import org.junit.Test; +import org.opendaylight.controller.config.util.xml.XmlUtil; +import org.w3c.dom.Document; public class NetconfUtilTest { @@ -23,9 +21,9 @@ public class NetconfUtilTest { public void testConflictingVersionDetection() throws Exception { Document document = XmlUtil.readXmlToDocument(getClass().getResourceAsStream("/netconfMessages/conflictingversion/conflictingVersionResponse.xml")); try{ - NetconfUtil.checkIsMessageOk(new NetconfMessage(document)); + NetconfUtil.checkIsMessageOk(document); fail(); - }catch(ConflictingVersionException e){ + }catch(IllegalStateException e){ assertThat(e.getMessage(), containsString("Optimistic lock failed. Expected parent version 21, was 18")); } }