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 2021/03/01 07:35:53 UTC

[camel] 03/05: CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-ECS component

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 646a49cea508faff04c55297db10473b750f4ca6
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 1 08:29:16 2021 +0100

    CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-ECS component
---
 .../component/aws2/ecs/ECS2ComponentConfigurationTest.java  | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurationTest.java b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurationTest.java
index c4ad284..7e0b39c 100644
--- a/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurationTest.java
+++ b/components/camel-aws2-ecs/src/test/java/org/apache/camel/component/aws2/ecs/ECS2ComponentConfigurationTest.java
@@ -22,6 +22,7 @@ import software.amazon.awssdk.core.Protocol;
 import software.amazon.awssdk.regions.Region;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class ECS2ComponentConfigurationTest extends CamelTestSupport {
 
@@ -68,4 +69,16 @@ public class ECS2ComponentConfigurationTest extends CamelTestSupport {
         assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort());
     }
 
+    @Test
+    public void createEndpointWithEndpointOverride() throws Exception {
+        ECS2Component component = context.getComponent("aws2-ecs", ECS2Component.class);
+        ECS2Endpoint endpoint
+                = (ECS2Endpoint) component.createEndpoint("aws2-ecs://label?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&overrideEndpoint=true&uriEndpointOverride=http://localhost:9090");
+
+        assertEquals("xxxxxx", endpoint.getConfiguration().getAccessKey());
+        assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey());
+        assertEquals("US_EAST_1", endpoint.getConfiguration().getRegion());
+        assertTrue(endpoint.getConfiguration().isOverrideEndpoint());
+        assertEquals("http://localhost:9090", endpoint.getConfiguration().getUriEndpointOverride());
+    }
 }