From 52a1a5a22a9bd4e183c8c0607e2b75f6503a43c9 Mon Sep 17 00:00:00 2001 From: Elena Kuleshov Date: Thu, 23 May 2019 02:07:32 -0400 Subject: Return empty WorkflowInputParameters Return empty WorkflowInputParameters when none are available Issue-ID: SO-1919 Signed-off-by: Kuleshov, Elena Change-Id: I057e30bb55f6545c25060c28e1af097286f4e88b --- .../org/onap/so/apihandlerinfra/WorkflowSpecificationsHandler.java | 4 ++-- .../src/test/resources/__files/catalogdb/WorkflowSpecifications.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'mso-api-handlers') 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 buildWorkflowInputParameters(Workflow workflow) { List workflowActivitySpecSequences = workflow.getWorkflowActivitySpecSequence(); if (workflowActivitySpecSequences == null || workflowActivitySpecSequences.size() == 0) { - return null; + return new ArrayList(); } Map workflowInputParameterMap = new HashMap(); for (WorkflowActivitySpecSequence workflowActivitySpecSequence : workflowActivitySpecSequences) { @@ -199,7 +199,7 @@ public class WorkflowSpecificationsHandler { } if (workflowInputParameterMap.size() == 0) { - return null; + return new ArrayList(); } List 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": [] } } ] -- cgit 1.2.3-korg