Merge "Do not force toString() in NetconfClientSession"
[controller.git] / opendaylight / netconf / netconf-util / src / test / java / org / opendaylight / controller / netconf / util / NetconfUtilTest.java
index b4b8aba81fc0513e5d7debf0aca749f1a592129b..dc175c57337205c27f76b03cd55c8af9ecf774fd 100644 (file)
@@ -7,25 +7,23 @@
  */
 package org.opendaylight.controller.netconf.util;
 
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
+import static org.hamcrest.CoreMatchers.containsString;
+
 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.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-import static org.junit.matchers.JUnitMatchers.containsString;
-
 public class NetconfUtilTest {
 
     @Test
     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"));
         }
     }