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 3c31d9d27411a1cf4550eb2c1f272583d2cd0587 Author: Andrea Cosentino <[email protected]> AuthorDate: Tue Mar 2 13:37:50 2021 +0100 CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-MQ component --- .../component/aws2/mq/MQComponentConfigurationTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentConfigurationTest.java b/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentConfigurationTest.java index 9c31f7c..7ce3c6f 100644 --- a/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentConfigurationTest.java +++ b/components/camel-aws2-mq/src/test/java/org/apache/camel/component/aws2/mq/MQComponentConfigurationTest.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 MQComponentConfigurationTest extends CamelTestSupport { @@ -67,4 +68,20 @@ public class MQComponentConfigurationTest extends CamelTestSupport { assertEquals("localhost", endpoint.getConfiguration().getProxyHost()); assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort()); } + + @Test + public void createEndpointWithOverride() throws Exception { + MQ2Component component = context.getComponent("aws2-mq", MQ2Component.class); + component.getConfiguration().setAccessKey("XXX"); + component.getConfiguration().setSecretKey("YYY"); + component.getConfiguration().setRegion(Region.US_WEST_1.toString()); + MQ2Endpoint endpoint + = (MQ2Endpoint) component.createEndpoint("aws2-mq://MyQueue?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1overrideEndpoint=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()); + } }
