You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by kr...@apache.org on 2019/08/30 18:22:37 UTC

[knox] branch master updated: KNOX-2002 - Fix KnoxShellTableTest build errors

This is an automated email from the ASF dual-hosted git repository.

krisden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new ea086a4  KNOX-2002 - Fix KnoxShellTableTest build errors
ea086a4 is described below

commit ea086a4f72aa0d62b0e2d840964361b584f41f8a
Author: Kevin Risden <kr...@apache.org>
AuthorDate: Fri Aug 30 14:22:23 2019 -0400

    KNOX-2002 - Fix KnoxShellTableTest build errors
---
 .../apache/knox/gateway/shell/KnoxShellTableTest.java  | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/gateway-shell/src/test/java/org/apache/knox/gateway/shell/KnoxShellTableTest.java b/gateway-shell/src/test/java/org/apache/knox/gateway/shell/KnoxShellTableTest.java
index 62dd8c9..e82fc45 100644
--- a/gateway-shell/src/test/java/org/apache/knox/gateway/shell/KnoxShellTableTest.java
+++ b/gateway-shell/src/test/java/org/apache/knox/gateway/shell/KnoxShellTableTest.java
@@ -18,12 +18,11 @@
 package org.apache.knox.gateway.shell;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertNull;
 
 import org.junit.Test;
 
 public class KnoxShellTableTest {
-
   @Test
   public void testSimpleTableRendering() {
     String expectedResult = "+------------+------------+------------+\n"
@@ -52,7 +51,6 @@ public class KnoxShellTableTest {
     table.row().value("123").value("456").value("344444444");
 
     assertEquals(expectedResult, table.toString());
-
   }
 
   @Test
@@ -70,7 +68,6 @@ public class KnoxShellTableTest {
     table.row().value("789").value("012").value("844444444");
 
     assertEquals(expectedResult, table.toString());
-
   }
 
   @Test
@@ -83,12 +80,11 @@ public class KnoxShellTableTest {
 
     table.row().value("123").value("456").value("344444444");
     table.row().value("789").value("012").value("844444444");
-    
-    assertEquals(expectedResult, table.toString());
 
+    assertEquals(expectedResult, table.toString());
   }
 
-  @Test
+  @Test (expected = IllegalStateException.class)
   public void testMultipleRowsTableMismatchedColAndHeadersCountError() {
     KnoxShellTable table = new KnoxShellTable();
 
@@ -97,12 +93,6 @@ public class KnoxShellTableTest {
     table.row().value("123").value("456").value("344444444");
     table.row().value("789").value("012").value("844444444");
 
-    try {
-      table.toString();
-      fail("IllegalStateException expected.");
-    }
-    catch (IllegalStateException ise) {
-      // expected
-    }
+    assertNull(table.toString());
   }
 }