aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraleemraja <ar00500721@techmahindra.com>2020-11-30 16:06:44 +0530
committeraleemraja <ar00500721@techmahindra.com>2020-11-30 16:06:56 +0530
commit6a0991f60e8d1962e70c7c18c985b6c652564311 (patch)
tree0dcd1a8e5d467e8190fda5e5df562b1f2c238db1
parent357eb5546afc888e917d3bcffa43fe1085ddcdf7 (diff)
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 <ar00500721@techmahindra.com>
-rw-r--r--src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java34
1 files changed, 18 insertions, 16 deletions
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<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;
}