From aaaf2801945c81f8822f748a3bcefc21e24d3aaf Mon Sep 17 00:00:00 2001 From: Ganesh Date: Mon, 27 Jun 2022 08:46:38 +0530 Subject: sonar issue, Replace these 3 tests with a single Parameterized one Signed-off-by: Ganesh Change-Id: I3868ba6b54e2412de99580d19165cff448937465 Issue-ID: CLI-444 --- .../cli/fw/output/print/TableGeneratorTest.java | 23 +++++----------------- 1 file 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> rows = new ArrayList>(); - 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> rows = new ArrayList>(); - 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); } -- cgit 1.2.3-korg