Fix GNPy functional tests issue due to Mg bump 20/88120/1
authorGilles Thouenon <gilles.thouenon@orange.com>
Fri, 28 Feb 2020 10:29:21 +0000 (11:29 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 28 Feb 2020 10:29:21 +0000 (11:29 +0100)
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Co-authored-by: Ahmed Triki <ahmed.triki.tn@gmail.com>
Change-Id: I418faab4b76899313c9d1ca86db4240704aaabd5

pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyServiceImpl.java

index 44ba0f543d84e9b23023c111007b036d0f475574..2bf8dfb6586bb7221b8681ac018b7d87bc06a0c5 100644 (file)
@@ -137,8 +137,11 @@ public class GnpyServiceImpl {
         ExplicitRouteObjects explicitRouteObjects = new ExplicitRouteObjectsBuilder()
             .setRouteObjectIncludeExclude(routeObjectIncludeExcludes).build();
         //Create Path Constraint
         ExplicitRouteObjects explicitRouteObjects = new ExplicitRouteObjectsBuilder()
             .setRouteObjectIncludeExclude(routeObjectIncludeExcludes).build();
         //Create Path Constraint
-        PathConstraints pathConstraints =
-            createPathConstraints(atoz.getRate().toJava(),atoz.getAToZWavelengthNumber().toJava());
+        Long atozWavelength = null;
+        if (atoz.getAToZWavelengthNumber() != null) {
+            atozWavelength = atoz.getAToZWavelengthNumber().toJava();
+        }
+        PathConstraints pathConstraints = createPathConstraints(atoz.getRate().toJava(), atozWavelength);
 
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();
 
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();
@@ -170,8 +173,11 @@ public class GnpyServiceImpl {
         ExplicitRouteObjects explicitRouteObjects = new ExplicitRouteObjectsBuilder()
             .setRouteObjectIncludeExclude(routeObjectIncludeExcludes).build();
         //Create Path Constraint
         ExplicitRouteObjects explicitRouteObjects = new ExplicitRouteObjectsBuilder()
             .setRouteObjectIncludeExclude(routeObjectIncludeExcludes).build();
         //Create Path Constraint
-        PathConstraints pathConstraints = createPathConstraints(ztoa.getRate().toJava(),
-            ztoa.getZToAWavelengthNumber().toJava());
+        Long ztoaWavelength = null;
+        if (ztoa.getZToAWavelengthNumber() != null) {
+            ztoaWavelength = ztoa.getZToAWavelengthNumber().toJava();
+        }
+        PathConstraints pathConstraints = createPathConstraints(ztoa.getRate().toJava(), ztoaWavelength);
 
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();
 
         // Create the path request
         List<PathRequest> pathRequestList = new ArrayList<>();