aboutsummaryrefslogtreecommitdiffstats
path: root/workflow-designer-be/src/test/java/org
diff options
context:
space:
mode:
authortalig <talig@amdocs.com>2018-10-02 11:21:21 +0300
committertalig <talig@amdocs.com>2018-10-02 11:21:21 +0300
commit3d9ca52e4b034eba283a54b1c0fb0533b9f4ac4c (patch)
tree99b44a691983617ad07b5fd71a1eefbcc11a42cc /workflow-designer-be/src/test/java/org
parent1c758acea9ce43fee28b0f8dcffa1234358b42c8 (diff)
Fix exception throwing violation detected by sonar
Change-Id: Iec96dbece79674741887dc39787e9e5520517836 Issue-ID: SDC-1806 Signed-off-by: talig <talig@amdocs.com>
Diffstat (limited to 'workflow-designer-be/src/test/java/org')
-rw-r--r--workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/SortingTest.java15
-rw-r--r--workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/VersionStatesFormatterTest.java2
2 files changed, 13 insertions, 4 deletions
diff --git a/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/SortingTest.java b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/SortingTest.java
index 29436449..4aefad4f 100644
--- a/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/SortingTest.java
+++ b/workflow-designer-be/src/test/java/org/onap/sdc/workflow/api/types/SortingTest.java
@@ -18,11 +18,17 @@ public class SortingTest {
@Test
public void setSortInvalid() {
- sorting.setSort("a");
+ sorting.setSort("name:asc:a,:,");
assertEquals(Collections.emptyList(), sorting.getSorts());
}
@Test
+ public void setSortAscByDefault() {
+ sorting.setSort("name");
+ assertEquals(Collections.singletonList(new Sort("name", true)), sorting.getSorts());
+ }
+
+ @Test
public void setSortAsc() {
sorting.setSort("name:asc");
assertEquals(Collections.singletonList(new Sort("name", true)), sorting.getSorts());
@@ -36,7 +42,10 @@ public class SortingTest {
@Test
public void setSortMoreThanOne() {
- sorting.setSort("name:asc,date:desc");
- assertEquals(Arrays.asList(new Sort("name", true), new Sort("date", false)), sorting.getSorts());
+ sorting.setSort("name:asc,type,date:desc");
+ assertEquals(Arrays.asList(
+ new Sort("name", true),
+ new Sort("type", true),
+ new Sort("date", false)), sorting.getSorts());
}
} \ No newline at end of file
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 c40aef3e..c4c6fbea 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
@@ -21,7 +21,7 @@ public class VersionStatesFormatterTest {
@Test
public void setVersionStateInvalid() {
- versionStateSet.setVersionState("aaa");
+ versionStateSet.setVersionState(",,a");
assertEquals(Collections.emptySet() ,versionStateSet.getVersionStates());
}