Adjust to mdsal CursorAware API changes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / databroker / ClientBackedReadTransactionTest.java
index 92cd99d825a594fb3733d0acce10f5f5202b2843..89c0519992b2c7830640ff2ceae7e4d80266b20b 100644 (file)
@@ -7,9 +7,9 @@
  */
 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 java.util.Optional;
 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,20 +25,19 @@ public class ClientBackedReadTransactionTest extends ClientBackedTransactionTest
     private ClientBackedReadTransaction object;
 
     @Mock
-    private NormalizedNode data;
+    private NormalizedNode<?, ?> data;
     @Mock
     private ClientActorContext clientContext;
     @Mock
     private ClientSnapshot delegate;
 
     @Override
-    ClientBackedReadTransaction object() throws Exception {
+    ClientBackedReadTransaction object() {
         return object;
     }
 
     @Before
-    @SuppressWarnings("unchecked")
-    public void setUp() throws Exception {
+    public void setUp() {
         MockitoAnnotations.initMocks(this);
 
         Mockito.doReturn(CLIENT_ID).when(clientContext).getIdentifier();
@@ -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
+}