You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/01/08 08:34:40 UTC
[camel] branch camel-2.23.x updated: Added test based on SO:
https://stackoverflow.com/questions/54023107/apache-camel-how-to-implement-an-optional-consumer-for-a-wire-tap/54049958
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 641f4f7 Added test based on SO: https://stackoverflow.com/questions/54023107/apache-camel-how-to-implement-an-optional-consumer-for-a-wire-tap/54049958
641f4f7 is described below
commit 641f4f72f68b211c07ea93e082056e5269b4b65b
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Jan 8 09:16:15 2019 +0100
Added test based on SO: https://stackoverflow.com/questions/54023107/apache-camel-how-to-implement-an-optional-consumer-for-a-wire-tap/54049958
---
.../component/direct/DirectNoConsumerTest.java | 27 +++++++++++++++++-----
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoConsumerTest.java b/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoConsumerTest.java
index d57cff5..5137f63 100644
--- a/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoConsumerTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/direct/DirectNoConsumerTest.java
@@ -86,11 +86,27 @@ public class DirectNoConsumerTest extends ContextTestSupport {
context.start();
- try {
- template.sendBody("direct:start", "Hello World");
- } catch (CamelExecutionException e) {
- assertIsInstanceOf(DirectConsumerNotAvailableException.class, e.getCause());
- }
+ template.sendBody("direct:start", "Hello World");
+ }
+
+ @Test
+ public void testWireTapFailIfNoConsumerFalse() throws Exception {
+ context.getComponent("direct", DirectComponent.class).setBlock(false);
+
+ context.addRoutes(new RouteBuilder() {
+ @Override
+ public void configure() throws Exception {
+ from("direct:start").wireTap("direct:foo?failIfNoConsumers=false").to("mock:foo");
+ }
+ });
+
+ context.start();
+
+ getMockEndpoint("mock:foo").expectedMessageCount(1);
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
}
@Test
@@ -141,7 +157,6 @@ public class DirectNoConsumerTest extends ContextTestSupport {
template.sendBody("direct:in", "Hello World");
assertMockEndpointsSatisfied();
-
}
@Test