X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fcommon%2Fservice%2FServiceTypeTest.java;h=b2fa4d60fa4563dd4a6fd0e9e201a47145c81b4e;hb=1b2f9f488bdd54e577c88c230c4875daccc0b93c;hp=0eeb37bb8b34a85cffe7b0d7cd62e34a53960339;hpb=c3ffdaeb8d778bfd34606c30e6370819f2f4d8b0;p=transportpce.git diff --git a/common/src/test/java/org/opendaylight/transportpce/common/service/ServiceTypeTest.java b/common/src/test/java/org/opendaylight/transportpce/common/service/ServiceTypeTest.java index 0eeb37bb8..b2fa4d60f 100644 --- a/common/src/test/java/org/opendaylight/transportpce/common/service/ServiceTypeTest.java +++ b/common/src/test/java/org/opendaylight/transportpce/common/service/ServiceTypeTest.java @@ -8,12 +8,13 @@ package org.opendaylight.transportpce.common.service; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import org.junit.Test; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.Mapping; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.MappingBuilder; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import org.junit.jupiter.api.Test; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.Mapping; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.MappingBuilder; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.PortQual; import org.opendaylight.yang.gen.v1.http.org.openroadm.device.types.rev191129.XpdrNodeTypes; import org.opendaylight.yangtools.yang.common.Uint32; @@ -21,42 +22,42 @@ import org.opendaylight.yangtools.yang.common.Uint32; public class ServiceTypeTest { @Test - public void getServiceTypeForServiceFormatUnknownTest() { + void getServiceTypeForServiceFormatUnknownTest() { String serviceType = ServiceTypes.getServiceType("toto", null, null); - assertNull("service-type should be null", serviceType); + assertNull(serviceType, "service-type should be null"); } @Test - public void getServiceTypeForServiceFormatOCTest() { + void getServiceTypeForServiceFormatOCTest() { String serviceType = ServiceTypes.getServiceType("OC", Uint32.valueOf(100), null); - assertEquals("service-type should be 100GEt", "100GEt", serviceType); + assertEquals("100GEt", serviceType, "service-type should be 100GEt"); serviceType = ServiceTypes.getServiceType("OC", null, null); - assertNull("service-type should be null", serviceType); + assertNull(serviceType, "service-type should be null"); } @Test - public void getServiceTypeForServiceFormatEthernetTest() { + void getServiceTypeForServiceFormatEthernetTest() { String serviceType = ServiceTypes.getServiceType("Ethernet", Uint32.valueOf(400), null); - assertEquals("service-type should be 400GE", "400GE", serviceType); + assertEquals("400GE", serviceType, "service-type should be 400GE"); serviceType = ServiceTypes.getServiceType("Ethernet", Uint32.valueOf(100), null); - assertEquals("service-type should be 100GEt", "100GEt", serviceType); + assertEquals("100GEt", serviceType, "service-type should be 100GEt"); Mapping mapping = new MappingBuilder() .setLogicalConnectionPoint("logicalConnectionPoint") .setPortQual(PortQual.XpdrClient.getName()) .build(); serviceType = ServiceTypes.getServiceType("Ethernet", Uint32.valueOf(100), mapping); - assertEquals("service-type should be 100GEt", "100GEt", serviceType); + assertEquals("100GEt", serviceType, "service-type should be 100GEt"); mapping = new MappingBuilder() .setLogicalConnectionPoint("logicalConnectionPoint") .setPortQual(PortQual.SwitchClient.getName()) .build(); serviceType = ServiceTypes.getServiceType("Ethernet", Uint32.valueOf(100), mapping); - assertEquals("service-type should be 100GEm", "100GEm", serviceType); + assertEquals("100GEm", serviceType, "service-type should be 100GEm"); serviceType = ServiceTypes.getServiceType("Ethernet", Uint32.valueOf(10), mapping); - assertEquals("service-type should be 10GE", "10GE", serviceType); + assertEquals("10GE", serviceType, "service-type should be 10GE"); serviceType = ServiceTypes.getServiceType("Ethernet", Uint32.valueOf(1), mapping); - assertEquals("service-type should be 1GE", "1GE", serviceType); + assertEquals("1GE", serviceType, "service-type should be 1GE"); mapping = new MappingBuilder() .setLogicalConnectionPoint("logicalConnectionPoint") @@ -64,32 +65,30 @@ public class ServiceTypeTest { .setXponderType(XpdrNodeTypes.Switch) .build(); serviceType = ServiceTypes.getServiceType("Ethernet", Uint32.valueOf(100), mapping); - assertEquals("service-type should be 100GEs", "100GEs", serviceType); + assertEquals("100GEs", serviceType, "service-type should be 100GEs"); } @Test - public void getOtnServiceTypeForServiceFormatEthernetTest() { + void getOtnServiceTypeForServiceFormatEthernetTest() { String serviceType = ServiceTypes.getOtnServiceType("toto", Uint32.valueOf(123)); - assertNull("service-type should be null", serviceType); + assertNull(serviceType, "service-type should be null"); serviceType = ServiceTypes.getOtnServiceType("Ethernet", Uint32.valueOf(123)); - assertNull("service-type should be null", serviceType); + assertNull(serviceType, "service-type should be null"); serviceType = ServiceTypes.getOtnServiceType("Ethernet", Uint32.valueOf(1)); - assertEquals("service-type should be 1GE", "1GE", serviceType); + assertEquals("1GE", serviceType, "service-type should be 1GE"); serviceType = ServiceTypes.getOtnServiceType("Ethernet", Uint32.valueOf(10)); - assertEquals("service-type should be 10GE", "10GE", serviceType); + assertEquals("10GE", serviceType, "service-type should be 10GE"); serviceType = ServiceTypes.getOtnServiceType("Ethernet", Uint32.valueOf(100)); - assertEquals("service-type should be 100GEm", "100GEm", serviceType); + assertEquals("100GEm", serviceType, "service-type should be 100GEm"); serviceType = ServiceTypes.getOtnServiceType("OTU", Uint32.valueOf(100)); - assertEquals("service-type should be OTU4", "OTU4", serviceType); + assertEquals("OTU4", serviceType, "service-type should be OTU4"); serviceType = ServiceTypes.getOtnServiceType("OTU", Uint32.valueOf(400)); - assertEquals("service-type should be OTUC4", "OTUC4", serviceType); + assertEquals("OTUC4", serviceType, "service-type should be OTUC4"); serviceType = ServiceTypes.getOtnServiceType("ODU", Uint32.valueOf(100)); - assertEquals("service-type should be ODU4", "ODU4", serviceType); + assertEquals("ODU4", serviceType, "service-type should be ODU4"); serviceType = ServiceTypes.getOtnServiceType("ODU", Uint32.valueOf(400)); - assertEquals("service-type should be ODUC4", "ODUC4", serviceType); - + assertEquals("ODUC4", serviceType, "service-type should be ODUC4"); } - } \ No newline at end of file