diff --git a/src/test/java/HttpEventCollector_JavaLoggingTest.java b/src/test/java/HttpEventCollector_JavaLoggingTest.java index 6c9ba56e..e5c007e1 100644 --- a/src/test/java/HttpEventCollector_JavaLoggingTest.java +++ b/src/test/java/HttpEventCollector_JavaLoggingTest.java @@ -278,7 +278,7 @@ public void errorHandlingInvalidToken() throws Exception { System.out.println("======print logEx"); - System.out.println(logEx.toString()); + System.out.println(logEx); System.out.println("======finish print logEx"); Assert.assertEquals("Invalid token", logEx.get(1).getErrorText()); Assert.assertEquals(4, logEx.get(1).getErrorCode()); @@ -338,9 +338,9 @@ public void errorHandlingDisabledHttpEventCollectorEndpoint() throws Exception { Assert.fail("didn't catch errors"); Assert.assertEquals(1, errors.size()); - System.out.println(logEx.toString()); + System.out.println(logEx); if (!StringUtils.containsAny(logEx.toString(), "Failed to connect to", "Remote host terminated the handshake", "Connection reset")) - Assert.fail(String.format("Unexpected error message '%s'", logEx.toString())); + Assert.fail(String.format("Unexpected error message '%s'", logEx)); } diff --git a/src/test/java/HttpEventCollector_Log4j2Test.java b/src/test/java/HttpEventCollector_Log4j2Test.java index 1d4b16fa..7cad5bf6 100644 --- a/src/test/java/HttpEventCollector_Log4j2Test.java +++ b/src/test/java/HttpEventCollector_Log4j2Test.java @@ -270,7 +270,7 @@ public void errorHandlingInvalidToken() throws Exception { } System.out.println("======print logEx"); - System.out.println(logEx.toString()); + System.out.println(logEx); System.out.println("======finish print logEx"); Assert.assertEquals("Invalid token", logEx.get(1).getErrorText()); Assert.assertEquals(4, logEx.get(1).getErrorCode()); @@ -327,7 +327,7 @@ public void errorHandlingDisabledHttpEventCollectorEndpoint() throws Exception { System.out.println(logEx); if (!StringUtils.containsAny(logEx.toString(), "Failed to connect to", "Remote host terminated the handshake", "Connection reset")) - Assert.fail(String.format("Unexpected error message '%s'", logEx.toString())); + Assert.fail(String.format("Unexpected error message '%s'", logEx)); } /** diff --git a/src/test/java/HttpEventCollector_LogbackTest.java b/src/test/java/HttpEventCollector_LogbackTest.java index 96ca3c33..30860ebd 100644 --- a/src/test/java/HttpEventCollector_LogbackTest.java +++ b/src/test/java/HttpEventCollector_LogbackTest.java @@ -256,7 +256,7 @@ public void errorHandlingInvalidToken() throws Exception { System.out.println("======print logEx"); - System.out.println(logEx.toString()); + System.out.println(logEx); System.out.println("======finish print logEx"); Assert.assertEquals("Invalid token", logEx.get(1).getErrorText()); Assert.assertEquals(4, logEx.get(1).getErrorCode()); @@ -317,9 +317,9 @@ public void errorHandlingDisabledHttpEventCollectorEndpoint() throws Exception { Assert.fail("didn't catch errors"); Assert.assertEquals(1, errors.size()); - System.out.println(logEx.toString()); + System.out.println(logEx); if (!StringUtils.containsAny(logEx.toString(), "Failed to connect to", "Remote host terminated the handshake", "Connection reset")) - Assert.fail(String.format("Unexpected error message '%s'", logEx.toString())); + Assert.fail(String.format("Unexpected error message '%s'", logEx)); } /**