You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/07/26 13:08:47 UTC

[camel] 01/03: Camel-IronMQ: Use BindToRegistry annotation wherever possible

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 a4d2898b31d582803c496aa105c2d06c60065d7c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jul 26 14:41:21 2019 +0200

    Camel-IronMQ: Use BindToRegistry annotation wherever possible
---
 .../apache/camel/component/ironmq/FromQueueToQueueTest.java | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/components/camel-ironmq/src/test/java/org/apache/camel/component/ironmq/FromQueueToQueueTest.java b/components/camel-ironmq/src/test/java/org/apache/camel/component/ironmq/FromQueueToQueueTest.java
index 93f1913..bb13ab4 100644
--- a/components/camel-ironmq/src/test/java/org/apache/camel/component/ironmq/FromQueueToQueueTest.java
+++ b/components/camel-ironmq/src/test/java/org/apache/camel/component/ironmq/FromQueueToQueueTest.java
@@ -20,6 +20,7 @@ import java.io.IOException;
 
 import io.iron.ironmq.EmptyQueueException;
 
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
@@ -40,7 +41,10 @@ public class FromQueueToQueueTest extends CamelTestSupport {
 
     @EndpointInject("ironmq:testqueue2?client=#ironMock")
     private IronMQEndpoint queue2;
-
+    
+    @BindToRegistry("ironMock")
+    IronMQClientMock mock = new IronMQClientMock("dummy", "dummy");
+    
     @Test
     public void shouldDeleteMessageFromQueue1() throws Exception {
 
@@ -77,13 +81,6 @@ public class FromQueueToQueueTest extends CamelTestSupport {
     }
 
     @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        registry.bind("ironMock", new IronMQClientMock("dummy", "dummy"));
-        return registry;
-    }
-
-    @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override