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 dd71466cc2d00beae1f58fe7affbf3ba509ad9d3
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Fri Feb 26 15:46:24 2021 +0100

    CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - 
AWS2-DDB Streams component
---
 .../ddbstream/DdbStreamComponentConfigurationTest.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git 
a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentConfigurationTest.java
 
b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentConfigurationTest.java
index f7f8368..22c4324 100644
--- 
a/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentConfigurationTest.java
+++ 
b/components/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentConfigurationTest.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 DdbStreamComponentConfigurationTest extends CamelTestSupport {
 
@@ -80,4 +81,18 @@ public class DdbStreamComponentConfigurationTest extends 
CamelTestSupport {
         assertEquals(Protocol.HTTP, 
endpoint.getConfiguration().getProxyProtocol());
     }
 
+    @Test
+    public void createEndpointWithOverrideEndpoint() throws Exception {
+        Ddb2StreamComponent component = context.getComponent("aws2-ddbstream", 
Ddb2StreamComponent.class);
+        component.getConfiguration().setAccessKey("XXX");
+        component.getConfiguration().setSecretKey("YYY");
+        Ddb2StreamEndpoint endpoint = (Ddb2StreamEndpoint) 
component.createEndpoint("aws2-ddbstreams://myTable?overrideEndpoint=true&uriEndpointOverride=http://localhost:9090";);
+
+        assertEquals("myTable", endpoint.getConfiguration().getTableName());
+        assertEquals("XXX", endpoint.getConfiguration().getAccessKey());
+        assertEquals("YYY", endpoint.getConfiguration().getSecretKey());
+        assertTrue(endpoint.getConfiguration().isOverrideEndpoint());
+        assertEquals("http://localhost:9090";, 
endpoint.getConfiguration().getUriEndpointOverride());
+    }
+
 }

Reply via email to