X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=netconf%2Fsal-netconf-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Fconnect%2Fnetconf%2Fsal%2Ftx%2FReadWriteTxTest.java;h=f9d882ea9010341097b5d066a51d447e4cb14b54;hb=af6992e683e759041acbc14b5217dd3171857ff7;hp=748c210e53822fe4079857515cc7478bb4509b7f;hpb=9c47997b7c185f02e8980cb127a48161aad916e3;p=netconf.git diff --git a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/ReadWriteTxTest.java b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/ReadWriteTxTest.java index 748c210e53..f9d882ea90 100644 --- a/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/ReadWriteTxTest.java +++ b/netconf/sal-netconf-connector/src/test/java/org/opendaylight/netconf/sal/connect/netconf/sal/tx/ReadWriteTxTest.java @@ -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>, ReadFailedException> resultFuture = - Futures.immediateCheckedFuture(Optional.of(TxTestUtils.getContainerNode())); - when(delegateReadTx.read(LogicalDatastoreType.CONFIGURATION, id)).thenReturn(resultFuture); + final CheckedFuture resultFuture = + Futures.immediateCheckedFuture(true); + when(delegateReadTx.exists(LogicalDatastoreType.CONFIGURATION, id)).thenReturn(resultFuture); final CheckedFuture 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 +}