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/03 13:26:41 UTC

[camel] 04/05: CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-SQS 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 b02628311eb7ad6e8341c38a7b359038c30027ef
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 3 14:16:24 2021 +0100

    CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-SQS component
---
 .../aws2/sqs/SqsComponentConfigurationTest.java         | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/components/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java b/components/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java
index 74af508..c549e3e 100644
--- a/components/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java
+++ b/components/camel-aws2-sqs/src/test/java/org/apache/camel/component/aws2/sqs/SqsComponentConfigurationTest.java
@@ -26,6 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class SqsComponentConfigurationTest extends CamelTestSupport {
 
@@ -328,4 +329,20 @@ public class SqsComponentConfigurationTest extends CamelTestSupport {
         assertEquals("localhost", endpoint.getConfiguration().getProxyHost());
         assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort());
     }
+
+    @Test
+    public void createEndpointWithOverride() throws Exception {
+        Sqs2Component component = context.getComponent("aws2-sqs", Sqs2Component.class);
+        Sqs2Endpoint endpoint
+                = (Sqs2Endpoint) component.createEndpoint(
+                        "aws2-sqs://MyQueue?accessKey=xxx&secretKey=yyy&region=US_WEST_1&overrideEndpoint=true&uriEndpointOverride=http://localhost:9090");
+
+        assertEquals("MyQueue", endpoint.getConfiguration().getQueueName());
+        assertEquals("xxx", endpoint.getConfiguration().getAccessKey());
+        assertEquals("yyy", endpoint.getConfiguration().getSecretKey());
+        assertEquals("US_WEST_1", endpoint.getConfiguration().getRegion());
+        assertTrue(endpoint.getConfiguration().isOverrideEndpoint());
+        assertEquals("http://localhost:9090", endpoint.getConfiguration().getUriEndpointOverride());
+
+    }
 }