Merge changes Ic434bf4a,I05a3fb18,I47a3783d,I8234bbfd
[controller.git] / opendaylight / netconf / config-netconf-connector / src / test / java / org / opendaylight / controller / netconf / confignetconfconnector / operations / ValidateTest.java
index de1ab71e013bd4c9b64eb2f5aff4b373a8d8d68a..89d9061426ac020dac0bcb41a0491b2295658b70 100644 (file)
@@ -8,20 +8,20 @@
 
 package org.opendaylight.controller.netconf.confignetconfconnector.operations;
 
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
 import org.junit.Test;
 import org.opendaylight.controller.config.api.ValidationException;
 import org.opendaylight.controller.netconf.api.NetconfDocumentedException;
+import org.opendaylight.controller.netconf.api.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.confignetconfconnector.transactions.TransactionProvider;
 import org.opendaylight.controller.netconf.util.xml.XmlElement;
-import org.opendaylight.controller.netconf.util.xml.XmlNetconfConstants;
 import org.opendaylight.controller.netconf.util.xml.XmlUtil;
 import org.w3c.dom.Element;
 
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.doNothing;
-import static org.mockito.Mockito.doThrow;
-import static org.mockito.Mockito.mock;
-
 public class ValidateTest {
 
     public static final String NETCONF_SESSION_ID_FOR_REPORTING = "foo";
@@ -30,7 +30,7 @@ public class ValidateTest {
     public void test() throws Exception {
         final XmlElement xml = XmlElement.fromString("<abc></abc>");
         final Validate validate = new Validate(null, null, NETCONF_SESSION_ID_FOR_REPORTING);
-        validate.handle(null, xml);
+        validate.handleWithNoSubsequentOperations(null, xml);
     }
 
     @Test(expected = NetconfDocumentedException.class)
@@ -38,14 +38,14 @@ public class ValidateTest {
         final XmlElement xml = XmlElement.fromString("<validate xmlns=\""
                 + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0 + "\"/>");
         final Validate validate = new Validate(null, null, NETCONF_SESSION_ID_FOR_REPORTING);
-        validate.handle(null, xml);
+        validate.handleWithNoSubsequentOperations(null, xml);
     }
 
     @Test(expected = NetconfDocumentedException.class)
     public void testNoNamespace() throws Exception {
         final XmlElement xml = XmlElement.fromString("<validate/>");
         final Validate validate = new Validate(null, null, NETCONF_SESSION_ID_FOR_REPORTING);
-        validate.handle(null, xml);
+        validate.handleWithNoSubsequentOperations(null, xml);
     }
 
     @Test(expected = NetconfDocumentedException.class)
@@ -55,7 +55,7 @@ public class ValidateTest {
                 + XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0
                 + "\"><source><running></running></source></validate>");
         final Validate validate = new Validate(null, null, NETCONF_SESSION_ID_FOR_REPORTING);
-        validate.handle(null, xml);
+        validate.handleWithNoSubsequentOperations(null, xml);
     }
 
     @Test(expected = NetconfDocumentedException.class)
@@ -66,7 +66,7 @@ public class ValidateTest {
         final TransactionProvider transactionProvider = mock(TransactionProvider.class);
         doThrow(IllegalStateException.class).when(transactionProvider).validateTransaction();
         final Validate validate = new Validate(transactionProvider, null, NETCONF_SESSION_ID_FOR_REPORTING);
-        validate.handle(null, xml);
+        validate.handleWithNoSubsequentOperations(null, xml);
     }
 
     @Test(expected = NetconfDocumentedException.class)
@@ -77,7 +77,7 @@ public class ValidateTest {
         final TransactionProvider transactionProvider = mock(TransactionProvider.class);
         doThrow(ValidationException.class).when(transactionProvider).validateTransaction();
         final Validate validate = new Validate(transactionProvider, null, NETCONF_SESSION_ID_FOR_REPORTING);
-        validate.handle(null, xml);
+        validate.handleWithNoSubsequentOperations(null, xml);
     }
 
     @Test
@@ -89,7 +89,7 @@ public class ValidateTest {
         final Element okElement = XmlUtil.readXmlToElement("<ok/>");
         doNothing().when(transactionProvider).validateTransaction();
         final Validate validate = new Validate(transactionProvider, null, NETCONF_SESSION_ID_FOR_REPORTING);
-        Element ok = validate.handle(XmlUtil.newDocument(), xml);
+        Element ok = validate.handleWithNoSubsequentOperations(XmlUtil.newDocument(), xml);
         assertEquals(XmlUtil.toString(okElement), XmlUtil.toString(ok));
     }