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/03/12 10:24:49 UTC

[camel] branch master updated: Camel-AWS EKS: Use BindToRegistry annotation where possible in tests

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 0936c05  Camel-AWS EKS: Use BindToRegistry annotation where possible in tests
0936c05 is described below

commit 0936c05057f7ab1adbab3d5be8aad5e3cc2fe3cb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 12 11:24:31 2019 +0100

    Camel-AWS EKS: Use BindToRegistry annotation where possible in tests
---
 .../apache/camel/component/aws/eks/EKSProducerTest.java   | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/components/camel-aws-eks/src/test/java/org/apache/camel/component/aws/eks/EKSProducerTest.java b/components/camel-aws-eks/src/test/java/org/apache/camel/component/aws/eks/EKSProducerTest.java
index 59271df..5c82c48 100644
--- a/components/camel-aws-eks/src/test/java/org/apache/camel/component/aws/eks/EKSProducerTest.java
+++ b/components/camel-aws-eks/src/test/java/org/apache/camel/component/aws/eks/EKSProducerTest.java
@@ -22,6 +22,7 @@ import com.amazonaws.services.eks.model.DescribeClusterResult;
 import com.amazonaws.services.eks.model.ListClustersResult;
 import com.amazonaws.services.eks.model.VpcConfigRequest;
 
+import org.apache.camel.BindToRegistry;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
@@ -33,6 +34,9 @@ import org.junit.Test;
 
 public class EKSProducerTest extends CamelTestSupport {
     
+    @BindToRegistry("amazonEksClient")
+    AmazonEKSClientMock clientMock = new AmazonEKSClientMock();
+    
     @EndpointInject(uri = "mock:result")
     private MockEndpoint mock;
     
@@ -110,17 +114,6 @@ public class EKSProducerTest extends CamelTestSupport {
         DeleteClusterResult resultGet = exchange.getIn().getBody(DeleteClusterResult.class);
         assertEquals("Test", resultGet.getCluster().getName());
     }
-    
-    @Override
-    protected JndiRegistry createRegistry() throws Exception {
-        JndiRegistry registry = super.createRegistry();
-        
-        AmazonEKSClientMock clientMock = new AmazonEKSClientMock();
-        
-        registry.bind("amazonEksClient", clientMock);
-        
-        return registry;
-    }
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {