Fix test mocking 27/81127/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 22 Mar 2019 19:40:03 +0000 (20:40 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 22 Mar 2019 19:55:44 +0000 (20:55 +0100)
MD-SAL store APIs require FluentFuture, not CheckedFuture, fix that
up.

Change-Id: I2222c6a56f8b7a1bcc6569ba84e01ce3b4904a51
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-dom-compat/src/test/java/org/opendaylight/controller/sal/core/compat/LegacyDOMDataBrokerAdapterTest.java

index ce375edb195a3d041063164636e901a46cc4b249..57a2b356e36550c46a674bb3e2babf4bf45ca10f 100644 (file)
@@ -11,9 +11,9 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyObject;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyObject;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.doAnswer;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
@@ -212,7 +212,7 @@ public class LegacyDOMDataBrokerAdapterTest {
 
         String errorMsg = "mock read error";
         Throwable cause = new RuntimeException();
 
         String errorMsg = "mock read error";
         Throwable cause = new RuntimeException();
-        doReturn(Futures.immediateFailedCheckedFuture(new org.opendaylight.mdsal.common.api.ReadFailedException(
+        doReturn(FluentFutures.immediateFailedFluentFuture(new org.opendaylight.mdsal.common.api.ReadFailedException(
                 errorMsg, cause))).when(mockConfigReadTx).read(TEST_PATH);
 
         try {
                 errorMsg, cause))).when(mockConfigReadTx).read(TEST_PATH);
 
         try {
@@ -512,7 +512,7 @@ public class LegacyDOMDataBrokerAdapterTest {
     }
 
     @SuppressWarnings("checkstyle:AvoidHidingCauseException")
     }
 
     @SuppressWarnings("checkstyle:AvoidHidingCauseException")
-    private static void commit(DOMDataWriteTransaction tx)
+    private static void commit(final DOMDataWriteTransaction tx)
             throws TransactionCommitFailedException, InterruptedException, TimeoutException {
         try {
             tx.commit().get(5, TimeUnit.SECONDS);
             throws TransactionCommitFailedException, InterruptedException, TimeoutException {
         try {
             tx.commit().get(5, TimeUnit.SECONDS);