Error in NBI serviceSpecification API 05/115505/1
authoraleemraja <ar00500721@techmahindra.com>
Mon, 30 Nov 2020 10:36:44 +0000 (16:06 +0530)
committeraleemraja <ar00500721@techmahindra.com>
Mon, 30 Nov 2020 10:36:56 +0000 (16:06 +0530)
- Fix for NBI serviceSpecification API Error in case of Nested Services.
- Added check for null and empty for groupProperties.

Issue-ID: EXTAPI-535
Change-Id: Ibbbbbd2d7021c16ea6291cc111e210ae26200135
Signed-off-by: aleemraja <ar00500721@techmahindra.com>
src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java

index 1c04581..2046ecf 100644 (file)
@@ -279,22 +279,24 @@ public class ToscaInfosProcessor {
        
        private HashMap<String, Object> getUserDefinedVFLevelInstanceParams(
                        Map<String, org.onap.sdc.toscaparser.api.Property> groupProperties, Map listOfVFLevelInputs) {
-
-               HashMap<String, Object> vnfLevelInstanceParams = new HashMap<>();
-               
-               for (Entry<String, org.onap.sdc.toscaparser.api.Property> entry : groupProperties.entrySet()) {
-
-                       org.onap.sdc.toscaparser.api.Property property = entry.getValue();
-                       
-                       if ((property.getValue().getClass() == GetInput.class)) {
-                               GetInput getInput = (GetInput) property.getValue();
-                               listOfVFLevelInputs.put(getInput.getInputName(), getInput.result());
-                               listOfVFLevelInputs.remove(property.getName());
-                       } else if(property.getName().equals("skip_post_instantiation_configuration")) {
-                               //Add skip_post_instantiation_configuration as vf Level Inputs
-                               listOfVFLevelInputs.put(property.getName(), property.getValue());
-                       }
-               }
+        
+       if(groupProperties != null && !groupProperties.isEmpty()) {
+
+                  for (Entry<String, org.onap.sdc.toscaparser.api.Property> entry : groupProperties.entrySet()) {
+
+                          org.onap.sdc.toscaparser.api.Property property = entry.getValue();
+
+                          if ((property.getValue().getClass() == GetInput.class)) {
+                               GetInput getInput = (GetInput) property.getValue();
+                                   listOfVFLevelInputs.put(getInput.getInputName(), getInput.result());
+                               listOfVFLevelInputs.remove(property.getName());
+                          } else if(property.getName().equals("skip_post_instantiation_configuration")) {
+                                   //Add skip_post_instantiation_configuration as vf Level Inputs
+                                   listOfVFLevelInputs.put(property.getName(), property.getValue());
+                          }
+                  }
+               
+          }
 
                return (HashMap<String, Object>) listOfVFLevelInputs;           
        }