This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 56e5c024228ae0d45e9f410ebd1a2ddade26e9cf Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Thu Jul 25 09:49:06 2019 +0200 Camel-guava-eventbus: Use BindToRegistry annotation wherever possible --- .../component/guava/eventbus/GuavaEventBusComponentTest.java | 10 +++------- .../component/guava/eventbus/GuavaEventBusConsumerTest.java | 10 +++------- .../guava/eventbus/GuavaEventBusConsumingDeadEventsTest.java | 10 +++------- .../component/guava/eventbus/GuavaEventBusProducerTest.java | 10 +++------- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusComponentTest.java b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusComponentTest.java index 64d6445..7552167 100644 --- a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusComponentTest.java +++ b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusComponentTest.java @@ -17,6 +17,8 @@ package org.apache.camel.component.guava.eventbus; import com.google.common.eventbus.EventBus; + +import org.apache.camel.BindToRegistry; import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.JndiRegistry; @@ -25,6 +27,7 @@ import org.junit.Test; public class GuavaEventBusComponentTest extends CamelTestSupport { + @BindToRegistry("eventBus") EventBus eventBus = new EventBus(); @Override @@ -46,13 +49,6 @@ public class GuavaEventBusComponentTest extends CamelTestSupport { return camelContext; } - @Override - protected JndiRegistry createRegistry() throws Exception { - JndiRegistry registry = super.createRegistry(); - registry.bind("eventBus", eventBus); - return registry; - } - @Test public void shouldForwardMessageToCustomComponent() throws InterruptedException { // Given diff --git a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumerTest.java b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumerTest.java index 65e8274..729b937 100644 --- a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumerTest.java +++ b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumerTest.java @@ -19,6 +19,8 @@ package org.apache.camel.component.guava.eventbus; import java.util.Date; import com.google.common.eventbus.EventBus; + +import org.apache.camel.BindToRegistry; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.JndiRegistry; import org.apache.camel.test.junit4.CamelTestSupport; @@ -26,6 +28,7 @@ import org.junit.Test; public class GuavaEventBusConsumerTest extends CamelTestSupport { + @BindToRegistry("eventBus") EventBus eventBus = new EventBus(); @Override @@ -48,13 +51,6 @@ public class GuavaEventBusConsumerTest extends CamelTestSupport { }; } - @Override - protected JndiRegistry createRegistry() throws Exception { - JndiRegistry registry = super.createRegistry(); - registry.bind("eventBus", eventBus); - return registry; - } - @Test public void shouldForwardMessageToCamel() throws InterruptedException { // Given diff --git a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumingDeadEventsTest.java b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumingDeadEventsTest.java index 745248a..686fc55 100644 --- a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumingDeadEventsTest.java +++ b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusConsumingDeadEventsTest.java @@ -20,6 +20,8 @@ import java.util.Date; import com.google.common.eventbus.DeadEvent; import com.google.common.eventbus.EventBus; + +import org.apache.camel.BindToRegistry; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.JndiRegistry; import org.apache.camel.test.junit4.CamelTestSupport; @@ -27,6 +29,7 @@ import org.junit.Test; public class GuavaEventBusConsumingDeadEventsTest extends CamelTestSupport { + @BindToRegistry("eventBus") EventBus eventBus = new EventBus(); @Override @@ -43,13 +46,6 @@ public class GuavaEventBusConsumingDeadEventsTest extends CamelTestSupport { }; } - @Override - protected JndiRegistry createRegistry() throws Exception { - JndiRegistry registry = super.createRegistry(); - registry.bind("eventBus", eventBus); - return registry; - } - @Test public void shouldForwardMessageToCamel() throws InterruptedException { // Given diff --git a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusProducerTest.java b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusProducerTest.java index c56a353..d06f97c 100644 --- a/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusProducerTest.java +++ b/components/camel-guava-eventbus/src/test/java/org/apache/camel/component/guava/eventbus/GuavaEventBusProducerTest.java @@ -18,6 +18,8 @@ package org.apache.camel.component.guava.eventbus; import com.google.common.eventbus.EventBus; import com.google.common.eventbus.Subscribe; + +import org.apache.camel.BindToRegistry; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.JndiRegistry; import org.apache.camel.test.junit4.CamelTestSupport; @@ -25,6 +27,7 @@ import org.junit.Test; public class GuavaEventBusProducerTest extends CamelTestSupport { + @BindToRegistry("eventBus") EventBus eventBus = new EventBus(); Object receivedEvent; @@ -39,13 +42,6 @@ public class GuavaEventBusProducerTest extends CamelTestSupport { }; } - @Override - protected JndiRegistry createRegistry() throws Exception { - JndiRegistry registry = super.createRegistry(); - registry.bind("eventBus", eventBus); - return registry; - } - @Test public void shouldReceiveMessageFromCamel() throws InterruptedException { // Given