aboutsummaryrefslogtreecommitdiffstats
path: root/mso-api-handlers
diff options
context:
space:
mode:
authorElena Kuleshov <evn@att.com>2019-05-23 02:07:32 -0400
committerElena Kuleshov <evn@att.com>2019-05-23 04:21:52 -0400
commit52a1a5a22a9bd4e183c8c0607e2b75f6503a43c9 (patch)
tree9293697f9dc5ad10a347fa06fa1ff896b06a44f6 /mso-api-handlers
parentb87ccbbf96a0eac4261f5a2d51c03e18b4243ddb (diff)
Return empty WorkflowInputParameters
Return empty WorkflowInputParameters when none are available Issue-ID: SO-1919 Signed-off-by: Kuleshov, Elena <evn@att.com> Change-Id: I057e30bb55f6545c25060c28e1af097286f4e88b
Diffstat (limited to 'mso-api-handlers')
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java4
-rw-r--r--mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json3
2 files changed, 4 insertions, 3 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
index e8171ac834..bba8064f7c 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
+++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java
@@ -175,7 +175,7 @@ public class WorkflowSpecificationsHandler {
private List<WorkflowInputParameter> buildWorkflowInputParameters(Workflow workflow) {
List<WorkflowActivitySpecSequence> workflowActivitySpecSequences = workflow.getWorkflowActivitySpecSequence();
if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.size() == 0) {
- return null;
+ return new ArrayList<WorkflowInputParameter>();
}
Map<String, WorkflowInputParameter> workflowInputParameterMap = new HashMap<String, WorkflowInputParameter>();
for (WorkflowActivitySpecSequence workflowActivitySpecSequence : workflowActivitySpecSequences) {
@@ -199,7 +199,7 @@ public class WorkflowSpecificationsHandler {
}
if (workflowInputParameterMap.size() == 0) {
- return null;
+ return new ArrayList<WorkflowInputParameter>();
}
List<WorkflowInputParameter> workflowInputParameterList =
workflowInputParameterMap.values().stream().collect(Collectors.toList());
diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
index 545fbbe26c..59bc12d92d 100644
--- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
+++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/catalogdb/WorkflowSpecifications.json
@@ -122,7 +122,8 @@
"operationName": "inPlaceSoftwareUpdate",
"workflowSource": "native",
"workflowResourceTarget": "vnf"
- }
+ },
+ "workflowInputParameters": []
}
}
]