BUG-2771: Converting String.split() to Guava Splitter
[openflowplugin.git] / openflowplugin / src / test / java / org / opendaylight / openflowplugin / openflow / md / core / sal / convertor / PacketOutConvertorTest.java
index ad4bf7eb3a0f981946da2152be11bf6f4c239770..9f0409efb8472e0e5c8df51d0d55763f6f1155bc 100644 (file)
@@ -17,6 +17,7 @@ import org.junit.Test;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;\r
 import org.opendaylight.openflowplugin.api.OFConstants;\r
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;\r
+import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;\r
 import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;\r
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;\r
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.OutputActionCaseBuilder;\r
@@ -215,9 +216,8 @@ public class PacketOutConvertorTest {
      */\r
     private static PortNumber getPortNumber(final NodeConnectorKey nConKey,\r
                                             final Short ofVersion) {\r
-        String[] split = nConKey.getId().getValue().split(":");\r
-        Long port = OpenflowPortsUtil.getPortFromLogicalName(\r
-                OpenflowVersion.get(ofVersion), split[split.length - 1]);\r
+        Long port = InventoryDataServiceUtil.portNumberfromNodeConnectorId(\r
+                OpenflowVersion.get(ofVersion), nConKey.getId());\r
         return new PortNumber(port);\r
     }\r
 \r