From: aleemraja Date: Mon, 30 Nov 2020 10:36:44 +0000 (+0530) Subject: Error in NBI serviceSpecification API X-Git-Tag: 8.0.0~3 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=externalapi%2Fnbi.git;a=commitdiff_plain;h=6a0991f60e8d1962e70c7c18c985b6c652564311 Error in NBI serviceSpecification API - 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 --- diff --git a/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java b/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java index 1c04581..2046ecf 100644 --- a/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java +++ b/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java @@ -279,22 +279,24 @@ public class ToscaInfosProcessor { private HashMap getUserDefinedVFLevelInstanceParams( Map groupProperties, Map listOfVFLevelInputs) { - - HashMap vnfLevelInstanceParams = new HashMap<>(); - - for (Entry 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 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) listOfVFLevelInputs; }