Refactor transportpce-routing-constraint model
[transportpce.git] / servicehandler / src / test / java / org / opendaylight / transportpce / servicehandler / MappingConstraintsTest.java
index bd64dce8932b7c596497ccaa34f2f13ba2a0f5bc..dbec3e2d59e9c80bf66986e5ba8c470d3f75f8d2 100644 (file)
@@ -10,12 +10,12 @@ package org.opendaylight.transportpce.servicehandler;
 import java.util.Arrays;
 import org.junit.Assert;
 import org.junit.Test;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.CoRoutingBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.constraints.co.routing.or.general.GeneralBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraints;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraintsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraints;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.CoRoutingBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.GeneralBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.HardConstraints;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.HardConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.SoftConstraints;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.SoftConstraintsBuilder;
 
 
 
@@ -23,33 +23,35 @@ public class MappingConstraintsTest {
 
     private HardConstraints buildHardConstraintWithCoRouting() {
         return new HardConstraintsBuilder()
-                .setCoRoutingOrGeneral(new CoRoutingBuilder()
-                        .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.openroadm.routing
-                                .constrains.rev161014.constraints.co.routing.or.general.co.routing
-                                .CoRoutingBuilder().setExistingService(
-                                Arrays.asList("Some existing-service")).build())
+            .setCoRoutingOrGeneral(new CoRoutingBuilder()
+                .setCoRouting(
+                    new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co
+                        .routing.or.general.co.routing.CoRoutingBuilder()
+                        .setExistingService(Arrays.asList("Some existing-service"))
                         .build())
-                .setCustomerCode(Arrays.asList("Some customer-code"))
-                .build();
+                .build())
+            .setCustomerCode(Arrays.asList("Some customer-code"))
+            .build();
     }
 
     private HardConstraints buildHardConstraintWithGeneral() {
         return new HardConstraintsBuilder()
-                .setCoRoutingOrGeneral(new GeneralBuilder().build())
-                .setCustomerCode(Arrays.asList("Some customer-code"))
-                .build();
+            .setCoRoutingOrGeneral(new GeneralBuilder().build())
+            .setCustomerCode(Arrays.asList("Some customer-code"))
+            .build();
     }
 
     private SoftConstraints buildSoftConstraintWithCoRouting() {
         return new SoftConstraintsBuilder()
-                .setCoRoutingOrGeneral(new CoRoutingBuilder()
-                        .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.openroadm.routing
-                                .constrains.rev161014.constraints.co.routing.or.general.co.routing
-                                .CoRoutingBuilder().setExistingService(
-                                Arrays.asList("Some existing-service")).build())
+            .setCoRoutingOrGeneral(new CoRoutingBuilder()
+                .setCoRouting(
+                    new org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co
+                        .routing.or.general.co.routing.CoRoutingBuilder()
+                        .setExistingService(Arrays.asList("Some existing-service"))
                         .build())
-                .setCustomerCode(Arrays.asList("Some customer-code"))
-                .build();
+                .build())
+            .setCustomerCode(Arrays.asList("Some customer-code"))
+            .build();
     }
 
     @Test
@@ -104,44 +106,58 @@ public class MappingConstraintsTest {
     @Test
     public void serviceToServicePathConstraintsParameterizedConstructor() {
         MappingConstraints mappingConstraints = new MappingConstraints(
-            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
-            .routing.constraints.rev171017.routing.constraints.sp.HardConstraintsBuilder()
-            .setCustomerCode(Arrays.asList("Some customer-code"))
-            .setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-                .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
-                .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-                    .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
-                    .setExistingService(Arrays.asList("Some existing-service"))
-                    .build())
-                .build()).build(),
-            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
-                .routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder()
+            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing
+                .constraints.sp.HardConstraintsBuilder()
                 .setCustomerCode(Arrays.asList("Some customer-code"))
-                .setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-                    .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
-                    .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-                        .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
-                        .setExistingService(Arrays.asList("Some existing-service"))
+                .setCoRoutingOrGeneral(
+                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118
+                        .constraints.sp.co.routing.or.general.CoRoutingBuilder()
+                        .setCoRouting(
+                            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
+                                .rev220118.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+                                .setExistingService(Arrays.asList("Some existing-service"))
+                                .build())
                         .build())
-                    .build()).build());
+                .build(),
+            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing
+                .constraints.sp.SoftConstraintsBuilder()
+                .setCustomerCode(Arrays.asList("Some customer-code"))
+                .setCoRoutingOrGeneral(
+                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118
+                        .constraints.sp.co.routing.or.general.CoRoutingBuilder()
+                        .setCoRouting(
+                            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
+                                .rev220118.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+                                .setExistingService(Arrays.asList("Some existing-service"))
+                                .build())
+                        .build())
+                .build());
 
         mappingConstraints.serviceToServicePathConstarints();
-        Assert.assertEquals(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-            .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
-            .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-                .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
-                .setExistingService(Arrays.asList("Some existing-service"))
-                .build())
-            .build(), mappingConstraints.getServicePathHardConstraints().getCoRoutingOrGeneral());
-        Assert.assertEquals(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface
-            .routing.constraints.rev171017.routing.constraints.sp.SoftConstraintsBuilder()
-            .setCustomerCode(Arrays.asList("Some customer-code"))
-            .setCoRoutingOrGeneral(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-                .constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder()
-                .setCoRouting(new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing
-                    .constraints.rev171017.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
-                    .setExistingService(Arrays.asList("Some existing-service"))
-                    .build())
-                .build()).build(), mappingConstraints.getServicePathSoftConstraints());
+        Assert.assertEquals(
+            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118
+                .constraints.sp.co.routing.or.general.CoRoutingBuilder()
+                .setCoRouting(
+                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118
+                        .constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+                        .setExistingService(Arrays.asList("Some existing-service"))
+                        .build())
+                .build(),
+            mappingConstraints.getServicePathHardConstraints().getCoRoutingOrGeneral());
+        Assert.assertEquals(
+            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118.routing
+                .constraints.sp.SoftConstraintsBuilder()
+                .setCustomerCode(Arrays.asList("Some customer-code"))
+                .setCoRoutingOrGeneral(
+                    new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev220118
+                        .constraints.sp.co.routing.or.general.CoRoutingBuilder()
+                        .setCoRouting(
+                            new org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints
+                                .rev220118.constraints.sp.co.routing.or.general.co.routing.CoRoutingBuilder()
+                                .setExistingService(Arrays.asList("Some existing-service"))
+                                .build())
+                        .build())
+                .build(),
+            mappingConstraints.getServicePathSoftConstraints());
     }
 }