diff options
Diffstat (limited to 'workflow-designer-be')
2 files changed, 4 insertions, 3 deletions
diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStatesFormatter.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStatesFormatter.java index 5467dee8..c9d3bf1e 100644 --- a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStatesFormatter.java +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStatesFormatter.java @@ -1,6 +1,7 @@ package org.onap.sdc.workflow.api.types; import java.util.Arrays; +import java.util.Collections; import java.util.Set; import java.util.stream.Collectors; import lombok.Getter; @@ -29,8 +30,8 @@ public class VersionStatesFormatter { .collect(Collectors.toSet()); } catch (Exception ignore) { LOGGER.info( - "value is invalid and cannot be formatted to a set of version states, therefore it set to null"); - return null; + "value is invalid and cannot be formatted to a set of version states, therefore it set to empty set"); + return Collections.emptySet(); } } } diff --git a/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/VersionStatesFormatterTest.java b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/VersionStatesFormatterTest.java index c57bd9c3..423c5e6c 100644 --- a/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/VersionStatesFormatterTest.java +++ b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/VersionStatesFormatterTest.java @@ -22,7 +22,7 @@ public class VersionStatesFormatterTest { @Test public void setVersionStateInvalid() { versionStateSet.setVersionState("aaa"); - assertNull(versionStateSet.getVersionStates()); + assertEquals(Collections.emptySet() ,versionStateSet.getVersionStates()); } @Test |