Use ConcurrentDataBrokerTestCustomizer in UTs
[netconf.git] / netconf / sal-netconf-connector / src / test / java / org / opendaylight / netconf / sal / connect / netconf / sal / tx / ReadWriteTxTest.java
index 748c210e53822fe4079857515cc7478bb4509b7f..f9d882ea9010341097b5d066a51d447e4cb14b54 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.netconf.sal.connect.netconf.sal.tx;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
-import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import org.junit.Assert;
@@ -26,7 +25,6 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.LeafNode;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 public class ReadWriteTxTest {
     @Mock
@@ -53,12 +51,6 @@ public class ReadWriteTxTest {
         verify(delegateWriteTx).merge(LogicalDatastoreType.CONFIGURATION, id2, leafNode);
         tx.delete(LogicalDatastoreType.CONFIGURATION, id2);
         verify(delegateWriteTx).delete(LogicalDatastoreType.CONFIGURATION, id2);
-        tx.submit();
-        verify(delegateWriteTx).submit();
-    }
-
-    @Test
-    public void commit() throws Exception {
         tx.commit();
         verify(delegateWriteTx).commit();
     }
@@ -78,9 +70,9 @@ public class ReadWriteTxTest {
     @Test
     public void exists() throws Exception {
         final YangInstanceIdentifier id = TxTestUtils.getContainerId();
-        final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> resultFuture =
-                Futures.immediateCheckedFuture(Optional.of(TxTestUtils.getContainerNode()));
-        when(delegateReadTx.read(LogicalDatastoreType.CONFIGURATION, id)).thenReturn(resultFuture);
+        final CheckedFuture<Boolean, ReadFailedException> resultFuture =
+                Futures.immediateCheckedFuture(true);
+        when(delegateReadTx.exists(LogicalDatastoreType.CONFIGURATION, id)).thenReturn(resultFuture);
         final CheckedFuture<Boolean, ReadFailedException> exists = tx.exists(LogicalDatastoreType.CONFIGURATION, id);
         Assert.assertTrue(exists.get());
     }
@@ -91,4 +83,4 @@ public class ReadWriteTxTest {
         Assert.assertNotEquals(tx.getIdentifier(), tx2.getIdentifier());
     }
 
-}
\ No newline at end of file
+}