Bump mdsal to 5.0.2
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / util / DeviceInitializationUtilTest.java
index cbceb9e8f25f48e86e0dd1432a6bbc790a1fce44..f01fcebffd59bbc62667fc44398b7c237eef81d8 100644 (file)
@@ -16,7 +16,6 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 import java.net.InetSocketAddress;
-import java.util.Collections;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -44,6 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.FeaturesReply;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint8;
 
 @RunWith(MockitoJUnitRunner.class)
 public class DeviceInitializationUtilTest {
@@ -51,7 +51,7 @@ public class DeviceInitializationUtilTest {
                 .createNodeInstanceIdentifier(new NodeId("openflow:1"));
     private static final int PORT = 2017;
     private static final InetSocketAddress INET_SOCKET_ADDRESS = new InetSocketAddress("192.168.0.1", PORT);
-    private static final short TABLES = 25;
+    private static final Uint8 TABLES = Uint8.valueOf(25);
 
     @Mock
     private DataBroker dataBroker;
@@ -75,7 +75,7 @@ public class DeviceInitializationUtilTest {
         when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction);
         when(connectionAdapter.getRemoteAddress()).thenReturn(INET_SOCKET_ADDRESS);
         when(featuresReply.getTables()).thenReturn(TABLES);
-        when(featuresReply.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
+        when(featuresReply.getVersion()).thenReturn(Uint8.valueOf(OFConstants.OFP_VERSION_1_3));
         when(featuresReply.getCapabilities()).thenReturn(new Capabilities(false, false,
                 false, false, false, false, false));
         when(connectionContext.getFeatures()).thenReturn(featuresReply);
@@ -88,7 +88,6 @@ public class DeviceInitializationUtilTest {
         verify(dataBroker).newWriteOnlyTransaction();
         verify(writeTransaction).merge(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier
                 .create(Nodes.class), new NodesBuilder()
-                .setNode(Collections.emptyList())
                 .build());
         verify(writeTransaction).commit();
     }
@@ -115,7 +114,7 @@ public class DeviceInitializationUtilTest {
     @Test
     public void getSwitchFeatures() {
         final SwitchFeatures switchFeatures = DeviceInitializationUtil.getSwitchFeatures(connectionContext);
-        assertEquals(TABLES, switchFeatures.getMaxTables().shortValue());
+        assertEquals(TABLES, switchFeatures.getMaxTables());
     }
 
-}
\ No newline at end of file
+}