OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / openflowplugin-impl / src / test / java / org / opendaylight / openflowplugin / impl / translator / PacketReceivedTranslatorTest.java
index 53c372d1275912560e7986e33daead6f1ea6ff4f..225ffb12cfb1a7271f980cb83a1e43ebc5292fae 100644 (file)
@@ -29,7 +29,6 @@ import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.ConvertorM
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PacketInReason;
@@ -83,15 +82,7 @@ public class PacketReceivedTranslatorTest {
         final List<PhyPort> phyPorts = Collections.singletonList(phyPort);
         convertorManager = ConvertorManagerFactory.createDefaultManager();
 
-        Mockito.when(deviceContext.getPrimaryConnectionContext()).thenReturn(connectionContext);
-        Mockito.when(connectionContext.getFeatures()).thenReturn(featuresReply);
-        Mockito.when(featuresReply.getDatapathId()).thenReturn(BigInteger.TEN);
-        Mockito.when(deviceContext.getDeviceState()).thenReturn(deviceState);
-        Mockito.when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
         Mockito.when(deviceInfo.getDatapathId()).thenReturn(BigInteger.TEN);
-        Mockito.when(getFeaturesOutput.getDatapathId()).thenReturn(BigInteger.TEN);
-        Mockito.when(getFeaturesOutput.getPhyPort()).thenReturn(phyPorts);
-        Mockito.when(phyPort.getPortNo()).thenReturn(PORT_NO_DS);
     }
 
     @Test
@@ -101,7 +92,6 @@ public class PacketReceivedTranslatorTest {
                 .child(Node.class, new NodeKey(new NodeId("openflow:10")));
         final PacketReceivedTranslator packetReceivedTranslator = new PacketReceivedTranslator(convertorManager);
         final PacketInMessage packetInMessage = createPacketInMessage(DATA.getBytes(), PORT_NO);
-        Mockito.when(deviceInfo.getNodeInstanceIdentifier()).thenReturn(nodePath);
 
         final PacketReceived packetReceived = packetReceivedTranslator.translate(packetInMessage, deviceInfo, null);
 
@@ -109,8 +99,7 @@ public class PacketReceivedTranslatorTest {
         Assert.assertEquals("org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.SendToController",
                 packetReceived.getPacketInReason().getName());
         Assert.assertEquals("openflow:10:" + PORT_NO,
-                packetReceived.getIngress().getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class)
-                        .getId().getValue());
+                packetReceived.getIngress().getValue().firstKeyOf(NodeConnector.class).getId().getValue());
         Assert.assertEquals(0L, packetReceived.getFlowCookie().getValue().longValue());
         Assert.assertEquals(42L, packetReceived.getTableId().getValue().longValue());
     }