diff options
author | Ganesh <ganesh.c@samsung.com> | 2022-06-27 08:46:38 +0530 |
---|---|---|
committer | Ganesh <ganesh.c@samsung.com> | 2022-06-27 08:46:48 +0530 |
commit | aaaf2801945c81f8822f748a3bcefc21e24d3aaf (patch) | |
tree | 6735697fb7bc6ba1b4bf0873356f34c1c5ee9254 | |
parent | 014c795415e9d29e9b4790c90fc6f4183c559ed4 (diff) |
sonar issue, Replace these 3 tests with a single Parameterized one
Signed-off-by: Ganesh <ganesh.c@samsung.com>
Change-Id: I3868ba6b54e2412de99580d19165cff448937465
Issue-ID: CLI-444
-rw-r--r-- | framework/src/test/java/org/onap/cli/fw/output/print/TableGeneratorTest.java | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/framework/src/test/java/org/onap/cli/fw/output/print/TableGeneratorTest.java b/framework/src/test/java/org/onap/cli/fw/output/print/TableGeneratorTest.java index 58ff4751..7622ff5f 100644 --- a/framework/src/test/java/org/onap/cli/fw/output/print/TableGeneratorTest.java +++ b/framework/src/test/java/org/onap/cli/fw/output/print/TableGeneratorTest.java @@ -54,32 +54,19 @@ public class TableGeneratorTest { System.out.println(result); String expected = "+----------+----------+\n|column1 |column2 |\n+----------+----------+\n"; assertEquals(expected, result); - } - - @Test - public void printTableNullCellTest() { - System.out.println("printTableNullCellTest..."); - List<List<Object>> rows = new ArrayList<List<Object>>(); - rows.add(Arrays.asList(new Object[] { "column1", "column2" })); rows.add(Arrays.asList(new Object[] { "value1", null })); - String result = table.generateTable(rows, true); + result = table.generateTable(rows, true); System.out.println(result); - String expected = "+----------+----------+\n" + "|column1 |column2 |\n" + "+----------+----------+\n" + expected = "+----------+----------+\n" + "|column1 |column2 |\n" + "+----------+----------+\n" + "|value1 | |\n" + "+----------+----------+\n"; assertEquals(expected, result); - } - - @Test - public void printTableEmptyCellTest() { - System.out.println("printTableEmptyCellTest..."); - List<List<Object>> rows = new ArrayList<List<Object>>(); - rows.add(Arrays.asList(new Object[] { "column1", "column2" })); rows.add(Arrays.asList(new Object[] { "value1", "" })); - String result = table.generateTable(rows, true); + result = table.generateTable(rows, true); System.out.println(result); - String expected = "+----------+----------+\n" + "|column1 |column2 |\n" + "+----------+----------+\n" + expected = "+----------+----------+\n" + "|column1 |column2 |\n" + "+----------+----------+\n" + + "|value1 | |\n" + "+----------+----------+\n" + "|value1 | |\n" + "+----------+----------+\n"; assertEquals(expected, result); } |