Convert mdsal submit() calls to commit()
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / databroker / ClientBackedReadTransactionTest.java
index 92cd99d825a594fb3733d0acce10f5f5202b2843..8333b4875e4f6b5e29a366c17c6b838deaf6babd 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.controller.cluster.databroker;
 
 import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -18,7 +18,6 @@ import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.opendaylight.controller.cluster.access.client.ClientActorContext;
 import org.opendaylight.controller.cluster.databroker.actors.dds.ClientSnapshot;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -26,7 +25,7 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest
     private ClientBackedReadTransaction object;
 
     @Mock
-    private NormalizedNode data;
+    private NormalizedNode<?, ?> data;
     @Mock
     private ClientActorContext clientContext;
     @Mock
@@ -38,7 +37,6 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest
     }
 
     @Before
-    @SuppressWarnings("unchecked")
     public void setUp() throws Exception {
         MockitoAnnotations.initMocks(this);
 
@@ -50,12 +48,12 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest
         Mockito.doReturn(Futures.immediateCheckedFuture(Optional.of(data))).when(delegate)
                 .read(YangInstanceIdentifier.EMPTY);
 
-        object = new ClientBackedReadTransaction(delegate, null);
+        object = new ClientBackedReadTransaction(delegate, null, null);
     }
 
     @Test
     public void testRead() throws Exception {
-        final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> result = object().read(
+        final ListenableFuture<Optional<NormalizedNode<?, ?>>> result = object().read(
                 YangInstanceIdentifier.EMPTY);
         final Optional<NormalizedNode<?, ?>> resultData = result.get();
         Assert.assertTrue(resultData.isPresent());
@@ -64,7 +62,7 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest
 
     @Test
     public void testExists() throws Exception {
-        final CheckedFuture<Boolean, ReadFailedException> result = object().exists(YangInstanceIdentifier.EMPTY);
+        final ListenableFuture<Boolean> result = object().exists(YangInstanceIdentifier.EMPTY);
         Assert.assertTrue(result.get());
     }
 }
\ No newline at end of file