Do not generate 'isFoo()' methods
[mdsal.git] / dom / mdsal-dom-broker / src / test / java / org / opendaylight / mdsal / dom / broker / TransactionChainReadTransactionTest.java
index 90d4c323cf608e4cdca0874ed48030b9009387e1..968df8f82b615188704ef3fd02681edcda2af84c 100644 (file)
@@ -9,18 +9,19 @@ package org.opendaylight.mdsal.dom.broker;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.atLeastOnce;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.FluentFuture;
 import org.junit.Test;
+import org.opendaylight.mdsal.common.api.CommitInfo;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 
 public class TransactionChainReadTransactionTest {
@@ -30,7 +31,7 @@ public class TransactionChainReadTransactionTest {
         final String identifier = "testIdent";
         final DOMDataTreeReadTransaction readTransaction = mock(DOMDataTreeReadTransaction.class);
         final ShardedDOMTransactionChainAdapter chainAdapter = mock(ShardedDOMTransactionChainAdapter.class);
-        ListenableFuture<Void> previousWriteTxFuture = Futures.immediateFuture(null);
+        FluentFuture<? extends CommitInfo> previousWriteTxFuture = FluentFutures.immediateNullFluentFuture();
 
         TransactionChainReadTransaction transactionChainReadTransaction =
                 new TransactionChainReadTransaction(identifier, readTransaction, previousWriteTxFuture, chainAdapter);
@@ -43,21 +44,21 @@ public class TransactionChainReadTransactionTest {
         verify(readTransaction).close();
         verify(chainAdapter).closeReadTransaction();
 
-        doReturn(Futures.immediateCheckedFuture(null)).when(readTransaction).read(any(), any());
+        doReturn(FluentFutures.immediateNullFluentFuture()).when(readTransaction).read(any(), any());
         assertNotNull(transactionChainReadTransaction.exists(
-                LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY));
-        transactionChainReadTransaction.read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY);
-        verify(readTransaction, atLeastOnce()).read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY);
+                LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty()));
+        transactionChainReadTransaction.read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty());
+        verify(readTransaction, atLeastOnce()).read(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty());
 
-        doReturn(Futures.immediateFailedCheckedFuture(
+        doReturn(FluentFutures.immediateFailedFluentFuture(
                 new NullPointerException())).when(readTransaction).read(any(), any());
         doNothing().when(chainAdapter).transactionFailed(any(), any());
         assertNotNull(transactionChainReadTransaction.read(
-                LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY));
-        previousWriteTxFuture = Futures.immediateFailedFuture(new NullPointerException());
+                LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty()));
+        previousWriteTxFuture = FluentFutures.immediateFailedFluentFuture(new NullPointerException());
         transactionChainReadTransaction =
                 new TransactionChainReadTransaction(identifier, readTransaction, previousWriteTxFuture, chainAdapter);
         assertNotNull(transactionChainReadTransaction.read(
-                LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.EMPTY));
+                LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.empty()));
     }
-}
\ No newline at end of file
+}