Adapt TransportPCE code to Chlorine
[transportpce.git] / tapi / src / test / java / org / opendaylight / transportpce / tapi / topology / ConvertORTopoToFullTapiTopoTest.java
index 61ae25e91c53ccb3af0eb650db16b42914259594..bf6919992c4429d1ab3102c6b0ec3748569649da 100644 (file)
@@ -776,7 +776,7 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
         assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA",
             1, node.getLayerProtocolName().size());
         assertEquals("otsi node should manage a single protocol layer : PHOTONIC_MEDIA",
-            LayerProtocolName.PHOTONICMEDIA, node.getLayerProtocolName().get(0));
+            LayerProtocolName.PHOTONICMEDIA, node.getLayerProtocolName().stream().findFirst().get());
 
         switch (otsiNodeType) {
             case "switch":
@@ -915,7 +915,7 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             3, nep.getSupportedCepLayerProtocolQualifier().size());
         assertThat("client nep should support 3 kind of cep",
             nep.getSupportedCepLayerProtocolQualifier(),
-            hasItems(ODUTYPEODU2.class, ODUTYPEODU2E.class, DIGITALSIGNALTYPE10GigELAN.class));
+            hasItems(ODUTYPEODU2.VALUE, ODUTYPEODU2E.VALUE, DIGITALSIGNALTYPE10GigELAN.VALUE));
         assertEquals("client nep should be of DSR protocol type", LayerProtocolName.DSR, nep.getLayerProtocolName());
         checkCommonPartOfNep(nep, false);
     }
@@ -933,9 +933,9 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
         assertThat("eODU nep should support 1, 2 or 3 kind of cep, depending on client port",
             nep.getSupportedCepLayerProtocolQualifier().size(), anyOf(is(1), is(2), is(3)));
         assertTrue("eODU nep should support 1 kind of cep",
-            nep.getSupportedCepLayerProtocolQualifier().stream().anyMatch(splc -> splc.equals(ODUTYPEODU0.class)
-                || splc.equals(ODUTYPEODU2.class) || splc.equals(ODUTYPEODU2E.class)
-                || splc.equals(ODUTYPEODU4.class)));
+            nep.getSupportedCepLayerProtocolQualifier().stream().anyMatch(splc -> splc.equals(ODUTYPEODU0.VALUE)
+                || splc.equals(ODUTYPEODU2.VALUE) || splc.equals(ODUTYPEODU2E.VALUE)
+                || splc.equals(ODUTYPEODU4.VALUE)));
         assertEquals("eODU nep should be of ODU protocol type", LayerProtocolName.ODU, nep.getLayerProtocolName());
         checkCommonPartOfNep(nep, withSip);
     }
@@ -953,7 +953,7 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             1, nep.getSupportedCepLayerProtocolQualifier().size());
         assertThat("network nep should support 1 kind of cep",
             nep.getSupportedCepLayerProtocolQualifier(),
-            hasItem(ODUTYPEODU4.class));
+            hasItem(ODUTYPEODU4.VALUE));
         assertEquals("network nep should be of ODU protocol type", LayerProtocolName.ODU, nep.getLayerProtocolName());
         checkCommonPartOfNep(nep, withSip);
     }
@@ -1150,7 +1150,7 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             2, nep.getSupportedCepLayerProtocolQualifier().size());
         assertThat("client nep should support 2 kind of cep",
             nep.getSupportedCepLayerProtocolQualifier(),
-            hasItems(ODUTYPEODU4.class, DIGITALSIGNALTYPE100GigE.class));
+            hasItems(ODUTYPEODU4.VALUE, DIGITALSIGNALTYPE100GigE.VALUE));
         assertEquals("client nep should be of DSR protocol type", LayerProtocolName.DSR, nep.getLayerProtocolName());
         checkCommonPartOfNep(nep, false);
     }
@@ -1166,7 +1166,7 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             1, nep.getSupportedCepLayerProtocolQualifier().size());
         assertThat("client nep should support 2 kind of cep",
             nep.getSupportedCepLayerProtocolQualifier(),
-            hasItems(DIGITALSIGNALTYPE100GigE.class));
+            hasItems(DIGITALSIGNALTYPE100GigE.VALUE));
         assertEquals("client nep should be of DSR protocol type", LayerProtocolName.DSR, nep.getLayerProtocolName());
         checkCommonPartOfNep(nep, false);
     }
@@ -1183,7 +1183,7 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             2, nep.getSupportedCepLayerProtocolQualifier().size());
         assertThat("OTSi nep should support 2 kind of cep",
             nep.getSupportedCepLayerProtocolQualifier(),
-            hasItems(PHOTONICLAYERQUALIFIEROMS.class, PHOTONICLAYERQUALIFIEROTSi.class));
+            hasItems(PHOTONICLAYERQUALIFIEROMS.VALUE, PHOTONICLAYERQUALIFIEROTSi.VALUE));
         assertEquals("OTSi nep should be of PHOTONIC_MEDIA protocol type",
             LayerProtocolName.PHOTONICMEDIA, nep.getLayerProtocolName());
         checkCommonPartOfNep(nep, withSip);
@@ -1201,7 +1201,7 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             1, nep.getSupportedCepLayerProtocolQualifier().size());
         assertThat("OTSi nep should support 2 kind of cep",
             nep.getSupportedCepLayerProtocolQualifier(),
-            hasItems(PHOTONICLAYERQUALIFIEROMS.class));
+            hasItems(PHOTONICLAYERQUALIFIEROMS.VALUE));
         assertEquals("OTSi nep should be of PHOTONIC_MEDIA protocol type",
             LayerProtocolName.PHOTONICMEDIA, nep.getLayerProtocolName());
         checkCommonPartOfNep(nep, withSip);
@@ -1273,7 +1273,8 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             new NameKey("OMS link name")).getValue());
         assertEquals("bad uuid for link", linkUuid, link.getUuid());
         assertEquals("oms link should be between 2 nodes of protocol layers PHOTONIC_MEDIA",
-            LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName());
+            LayerProtocolName.PHOTONICMEDIA.getName(),
+            link.getLayerProtocolName().stream().findFirst().get().getName());
         assertEquals("otn tapi link should be BIDIRECTIONAL",
             ForwardingDirection.BIDIRECTIONAL, link.getDirection());
         List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210
@@ -1305,7 +1306,8 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
             new NameKey("XPDR-RDM link name")).getValue());
         assertEquals("bad uuid for link", linkUuid, link.getUuid());
         assertEquals("oms link should be between 2 nodes of protocol layers PHOTONIC_MEDIA",
-            LayerProtocolName.PHOTONICMEDIA.getName(), link.getLayerProtocolName().get(0).getName());
+            LayerProtocolName.PHOTONICMEDIA.getName(),
+            link.getLayerProtocolName().stream().findFirst().get().getName());
         assertEquals("otn tapi link should be BIDIRECTIONAL",
             ForwardingDirection.BIDIRECTIONAL, link.getDirection());
         List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210