Migrate openflowplugim-impl tests to uint types
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / device / initialization / OF10DeviceInitializerTest.java
index 7041f3455ef323e2ccf4db3a52a41979fe75218d..d5929bdec42d6c35053b5dc3a700989dcf356092 100644 (file)
@@ -5,11 +5,10 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.device.initialization;
 
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -20,8 +19,8 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.connection.OutboundQueueProvider;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -44,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.features.reply.PhyPortBuilder;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 @RunWith(MockitoJUnitRunner.class)
 public class OF10DeviceInitializerTest {
@@ -76,7 +76,7 @@ public class OF10DeviceInitializerTest {
     private AbstractDeviceInitializer deviceInitializer;
 
     @Before
-    public void setUp() throws Exception {
+    public void setUp() {
         final KeyedInstanceIdentifier<Node, NodeKey> nodeInstanceIdentifier = DeviceStateUtil
                 .createNodeInstanceIdentifier(new NodeId("openflow:1"));
 
@@ -84,7 +84,7 @@ public class OF10DeviceInitializerTest {
         when(featuresReply.getCapabilitiesV10()).thenReturn(capabilitiesV10);
         when(featuresReply.getPhyPort()).thenReturn(Collections
                 .singletonList(new PhyPortBuilder()
-                        .setPortNo(42L)
+                        .setPortNo(Uint32.valueOf(42))
                         .build()));
         when(connectionContext.getFeatures()).thenReturn(featuresReply);
         when(connectionContext.getOutboundQueueProvider()).thenReturn(outboundQueueProvider);
@@ -94,7 +94,7 @@ public class OF10DeviceInitializerTest {
         when(deviceContext.getMessageSpy()).thenReturn(messageSpy);
         when(translatorLibrary.lookupTranslator(any())).thenReturn(messageTranslator);
         when(deviceContext.oook()).thenReturn(translatorLibrary);
-        when(requestContext.getXid()).thenReturn(new Xid(42L));
+        when(requestContext.getXid()).thenReturn(new Xid(Uint32.valueOf(42L)));
         when(requestContext.getFuture()).thenReturn(RpcResultBuilder.success().buildFuture());
         when(deviceContext.createRequestContext()).thenReturn(requestContext);
         when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);