Merge "Refactor TAPI ConvertORTopoToTapiTopo Junit"
authorGilles Thouenon <gilles.thouenon@orange.com>
Thu, 8 Feb 2024 15:10:23 +0000 (15:10 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 8 Feb 2024 15:10:23 +0000 (15:10 +0000)
lighty/pom.xml
tapi/src/test/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToFullTapiTopoTest.java

index f1474f84ce2852f032d1a0b27a5e822619d349f2..5a00fbda1af43ecc405e897b99854b82a6fba241 100644 (file)
@@ -86,7 +86,7 @@
     </dependency>
     <dependency>
       <groupId>org.opendaylight.transportpce.models</groupId>
-      <artifactId>tapi-2.1.1</artifactId>
+      <artifactId>tapi-2.4.0</artifactId>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.transportpce</groupId>
index a01165d7d26c0a2491763ae31ad250db5be3fbf2..0c371e95de83d10b88e5c7ed3eb29bfd952a1367 100644 (file)
@@ -1298,28 +1298,19 @@ public class ConvertORTopoToFullTapiTopoTest extends AbstractTest {
 
     private Integer nrgContainsClientAndNetwork(List<NodeRuleGroup> nrgList, Uuid clientNepUuid, Uuid networkNepUuid) {
         // 1 NRG should at least contain the NEP of interest in the NEP List
-        Boolean foundClient = false;
-        Boolean foundNetwork = false;
         Integer indexNrg = 0;
         for (NodeRuleGroup nrg : nrgList) {
+            Boolean foundClient = false;
+            Boolean foundNetwork = false;
             for (NodeEdgePoint nep : nrg.nonnullNodeEdgePoint().values()) {
-                if (nep.getNodeEdgePointUuid().equals(clientNepUuid)) {
-                    foundClient = true;
-                } else if (nep.getNodeEdgePointUuid().equals(networkNepUuid)) {
-                    foundNetwork = true;
-                }
+                foundClient = foundClient || nep.getNodeEdgePointUuid().equals(clientNepUuid);
+                foundNetwork = foundNetwork || nep.getNodeEdgePointUuid().equals(networkNepUuid);
             }
             if (foundClient && foundNetwork) {
-                break;
-            } else {
-                foundClient = false;
-                foundNetwork = false;
+                return indexNrg;
             }
             indexNrg++;
         }
-        if (foundClient && foundNetwork) {
-            return indexNrg;
-        }
         return null;
     }