Migrate tapi notification functional tests to 2.4
[transportpce.git] / tapi / src / main / java / org / opendaylight / transportpce / tapi / validation / CreateConnectivityServiceValidation.java
index bbe70fe471da59139c8efe5c96e7d50803332a39..b36f75c78fe5b57f931b2789a9933ade6974f05f 100644 (file)
@@ -66,12 +66,14 @@ public final class CreateConnectivityServiceValidation {
             return OperationResult.failed(resilienceConstraintCheckResult.getMessage());
         }
 
-        LOG.info("checking TopoConstraint...");
-        Map<TopologyConstraintKey, TopologyConstraint> topoConstraintMap = input.getTopologyConstraint();
-        for (Map.Entry<TopologyConstraintKey, TopologyConstraint> topoConstraint: topoConstraintMap.entrySet()) {
-            ComplianceCheckResult topoConstraintCheckResult = TopoConstraintCheck.check(topoConstraint.getValue());
-            if (!topoConstraintCheckResult.hasPassed()) {
-                return OperationResult.failed(topoConstraintCheckResult.getMessage());
+        if (input.getTopologyConstraint() != null) {
+            LOG.info("checking TopoConstraint...");
+            Map<TopologyConstraintKey, TopologyConstraint> topoConstraintMap = input.getTopologyConstraint();
+            for (Map.Entry<TopologyConstraintKey, TopologyConstraint> topoConstraint: topoConstraintMap.entrySet()) {
+                ComplianceCheckResult topoConstraintCheckResult = TopoConstraintCheck.check(topoConstraint.getValue());
+                if (!topoConstraintCheckResult.hasPassed()) {
+                    return OperationResult.failed(topoConstraintCheckResult.getMessage());
+                }
             }
         }
         LOG.info("create-connectivity-service topo constraints compliant !");