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


The following commit(s) were added to refs/heads/master by this push:
     new 992270b  Camel-AWS SNS: Use BindToRegistry annotation where possible 
in tests
992270b is described below

commit 992270b738c9bb275d31b9b4a36b216dde67def1
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Tue Mar 19 11:02:15 2019 +0100

    Camel-AWS SNS: Use BindToRegistry annotation where possible in tests
---
 .../apache/camel/component/aws/sns/SnsComponentTest.java    | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git 
a/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentTest.java
 
b/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentTest.java
index e0a987e..bbd668f 100644
--- 
a/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentTest.java
+++ 
b/components/camel-aws-sns/src/test/java/org/apache/camel/component/aws/sns/SnsComponentTest.java
@@ -16,15 +16,18 @@
  */
 package org.apache.camel.component.aws.sns;
 
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 public class SnsComponentTest extends CamelTestSupport {
+       
+    @BindToRegistry("amazonSNSClient")
+    AmazonSNSClientMock client = new AmazonSNSClientMock();
     
     @Test
     public void sendInOnly() throws Exception {
@@ -49,14 +52,6 @@ public class SnsComponentTest extends CamelTestSupport {
         
         assertEquals("dcc8ce7a-7f18-4385-bedd-b97984b4363c", 
exchange.getOut().getHeader(SnsConstants.MESSAGE_ID));
     }
-    
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        registry.bind("amazonSNSClient", new AmazonSNSClientMock());
-        
-        return registry;
-    }
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {

Reply via email to