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/02 08:34:08 UTC

[camel] 06/10: CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-Lambda 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 05624143fc86df146c02d37b68d4d4fcea2d0001
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Mar 2 09:03:29 2021 +0100

    CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-Lambda component
---
 .../aws2/lambda/LambdaComponentConfigurationTest.java      | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentConfigurationTest.java b/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentConfigurationTest.java
index e4ce92d..0914916 100644
--- a/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentConfigurationTest.java
+++ b/components/camel-aws2-lambda/src/test/java/org/apache/camel/component/aws2/lambda/LambdaComponentConfigurationTest.java
@@ -126,4 +126,18 @@ public class LambdaComponentConfigurationTest extends CamelTestSupport {
         assertEquals("localhost", endpoint.getConfiguration().getProxyHost());
         assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort());
     }
+
+    @Test
+    public void createEndpointWithOverride() throws Exception {
+        Lambda2Component component = context.getComponent("aws2-lambda", Lambda2Component.class);
+        Lambda2Endpoint endpoint = (Lambda2Endpoint) component
+                .createEndpoint("aws2-lambda://myFunction?accessKey=xxxxxx&secretKey=yyyyy&region=US_EAST_1&overrideEndpoint=true&uriEndpointOverride=http://localhost:9090");
+
+        assertEquals("myFunction", endpoint.getFunction());
+        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());
+    }
 }