[camel] branch camel-2.23.x updated: CAMEL-13236: mock endpoint - Small glitch in logging excepted failure

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch camel-2.23.x updated: CAMEL-13236: mock endpoint - Small glitch in logging excepted failure

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

davsclaus pushed a commit to branch camel-2.23.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.23.x by this push:
     new b0ce0aa  CAMEL-13236: mock endpoint - Small glitch in logging excepted failure
b0ce0aa is described below

commit b0ce0aa8dda7c21aacb0a60e7775b9b3fbb8938b
Author: Claus Ibsen <[hidden email]>
AuthorDate: Thu Feb 21 12:50:36 2019 +0100

    CAMEL-13236: mock endpoint - Small glitch in logging excepted failure
---
 .../java/org/apache/camel/component/mock/MockEndpoint.java | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index 6bb30e4..4f5ddd7 100644
--- a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -434,7 +434,12 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
             // did not throw expected error... fail!
             failed = true;
         } catch (AssertionError e) {
-            LOG.info("Caught expected failure: {}", e);
+            if (LOG.isDebugEnabled()) {
+                // log incl stacktrace
+                LOG.debug("Caught expected failure: " + e.getMessage(), e);
+            } else {
+                LOG.info("Caught expected failure: " + e.getMessage());
+            }
         }
         if (failed) {
             // fail() throws the AssertionError to indicate the test failed.
@@ -455,7 +460,12 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
             // did not throw expected error... fail!
             failed = true;
         } catch (AssertionError e) {
-            LOG.info("Caught expected failure: {}", e);
+            if (LOG.isDebugEnabled()) {
+                // log incl stacktrace
+                LOG.debug("Caught expected failure: " + e.getMessage(), e);
+            } else {
+                LOG.info("Caught expected failure: " + e.getMessage());
+            }
         }
         if (failed) {
             // fail() throws the AssertionError to indicate the test failed.