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 2020/11/13 13:52:44 UTC

[camel] 03/05: CAMEL-15836 - Camel-AWS2-EC2: enable autowire on the Ec2 client, fixed test

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 0caa6d7bbcd6c665a6a5d55beceb5a99a903c7eb
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 13 14:33:06 2020 +0100

    CAMEL-15836 - Camel-AWS2-EC2: enable autowire on the Ec2 client, fixed test
---
 .../aws2/ec2/EC2ComponentClientRegistryTest.java          | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java b/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java
index 9e5f94f..5cef4c4 100644
--- a/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java
+++ b/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentClientRegistryTest.java
@@ -20,7 +20,6 @@ import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -47,19 +46,7 @@ public class EC2ComponentClientRegistryTest extends CamelTestSupport {
     }
 
     @Test
-    public void createEndpointWithAutoDiscoverClientFalse() throws Exception {
-
-        AmazonEC2ClientMock clientMock = new AmazonEC2ClientMock();
-        context.getRegistry().bind("amazonEc2Client", clientMock);
-        AWS2EC2Component component = context.getComponent("aws2-ec2", AWS2EC2Component.class);
-        AWS2EC2Endpoint endpoint = (AWS2EC2Endpoint) component
-                .createEndpoint("aws2-ec2://TestDomain?accessKey=xxx&secretKey=yyyy&autoDiscoverClient=false");
-
-        assertNotSame(clientMock, endpoint.getConfiguration().getAmazonEc2Client());
-    }
-
-    @Test
-    public void createEndpointWithAutoDiscoverClientTrue() throws Exception {
+    public void createEndpointWithAutowired() throws Exception {
 
         AmazonEC2ClientMock clientMock = new AmazonEC2ClientMock();
         context.getRegistry().bind("amazonEc2Client", clientMock);