aboutsummaryrefslogtreecommitdiffstats
path: root/workflow-designer-be/src
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2018-08-05 10:47:36 +0300
committertalig <talig@amdocs.com>2018-08-05 10:47:36 +0300
commit02201e449b644790e99bbb230579d96cae4a53da (patch)
tree3e5973374ff5c6d2527e5ff9d1ae2249b033a581 /workflow-designer-be/src
parentd7d290e97e8403e0feffaef20fa7de4fa0e84b91 (diff)
Refactor and add test flows
Small fix in version state filter Change-Id: I015cbc52b8620b92ebb4f8f0167711e39d9d30a8 Issue-ID: SDC-1503 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'workflow-designer-be/src')
-rw-r--r--workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/types/VersionStatesFormatter.java5
-rw-r--r--workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/VersionStatesFormatterTest.java2
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