Update MRI upstreams for Phosphorus
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / services / sal / SalTableServiceImplTest.java
index a73ed9aa46eab22014765aee35b55819810d990f..95e96ac22a08ab6f31dae0a598d4855c4d6685a0 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.openflowplugin.impl.services.sal;
 
-import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
@@ -18,7 +18,6 @@ import java.util.List;
 import java.util.concurrent.Future;
 import org.junit.Assert;
 import org.junit.Test;
-import org.mockito.ArgumentMatchers;
 import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.stubbing.Answer;
@@ -40,6 +39,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.Upd
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.table.update.UpdatedTableBuilder;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 public class SalTableServiceImplTest extends ServiceMocking {
 
@@ -57,9 +58,7 @@ public class SalTableServiceImplTest extends ServiceMocking {
             final FutureCallback<OfHeader> callback = (FutureCallback<OfHeader>) invocation.getArguments()[2];
             callback.onSuccess(null);
             return null;
-        })
-                .when(mockedOutboundQueue).commitEntry(
-                anyLong(), ArgumentMatchers.any(), ArgumentMatchers.any());
+        }).when(mockedOutboundQueue).commitEntry(any(Uint32.class), any(), any());
 
         final ConvertorManager convertorManager = ConvertorManagerFactory.createDefaultManager();
         salTableService = new SalTableServiceImpl(mockedRequestContextStack, mockedDeviceContext,
@@ -73,7 +72,7 @@ public class SalTableServiceImplTest extends ServiceMocking {
                     RpcResultBuilder.<List<MultipartReply>>failed().build();
             handleResultFuture.set(rpcResult);
             return null;
-        }).when(multiMessageCollector).endCollecting(ArgumentMatchers.any());
+        }).when(multiMessageCollector).endCollecting(any());
 
         final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
         Assert.assertNotNull(rpcResultFuture);
@@ -88,7 +87,7 @@ public class SalTableServiceImplTest extends ServiceMocking {
                     .build();
             handleResultFuture.set(rpcResult);
             return null;
-        }).when(multiMessageCollector).endCollecting(ArgumentMatchers.any());
+        }).when(multiMessageCollector).endCollecting(any());
 
         final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
         Assert.assertNotNull(rpcResultFuture);
@@ -99,9 +98,9 @@ public class SalTableServiceImplTest extends ServiceMocking {
     public void testUpdateTableSuccess() {
         Mockito.doAnswer((Answer<Void>) invocation -> {
             TableFeaturesBuilder tableFeaturesBld = new TableFeaturesBuilder()
-                    .setTableId((short) 0)
+                    .setTableId(Uint8.ZERO)
                     .setName("Zafod")
-                    .setMaxEntries(42L)
+                    .setMaxEntries(Uint32.valueOf(42))
                     .setTableFeatureProperties(Collections.emptyList());
             MultipartReplyTableFeaturesBuilder mpTableFeaturesBld = new MultipartReplyTableFeaturesBuilder()
                     .setTableFeatures(Collections.singletonList(tableFeaturesBld.build()));
@@ -110,13 +109,13 @@ public class SalTableServiceImplTest extends ServiceMocking {
             MultipartReplyMessageBuilder mpResultBld = new MultipartReplyMessageBuilder()
                     .setType(MultipartType.OFPMPTABLEFEATURES)
                     .setMultipartReplyBody(mpBodyBld.build())
-                    .setXid(21L);
+                    .setXid(Uint32.valueOf(21));
             final RpcResult<List<MultipartReply>> rpcResult = RpcResultBuilder
                     .success(Collections.singletonList((MultipartReply) mpResultBld.build()))
                     .build();
             handleResultFuture.set(rpcResult);
             return null;
-        }).when(multiMessageCollector).endCollecting(ArgumentMatchers.any());
+        }).when(multiMessageCollector).endCollecting(any());
 
         final Future<RpcResult<UpdateTableOutput>> rpcResultFuture = salTableService.updateTable(prepareUpdateTable());
         Assert.assertNotNull(rpcResultFuture);
@@ -126,7 +125,7 @@ public class SalTableServiceImplTest extends ServiceMocking {
     private static UpdateTableInput prepareUpdateTable() {
         UpdateTableInputBuilder updateTableInputBuilder = new UpdateTableInputBuilder();
         UpdatedTableBuilder updatedTableBuilder = new UpdatedTableBuilder();
-        updatedTableBuilder.setTableFeatures(Collections.emptyList());
+        updatedTableBuilder.setTableFeatures(Collections.emptyMap());
         updateTableInputBuilder.setUpdatedTable(updatedTableBuilder.build());
         return updateTableInputBuilder.build();
     }