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 4c8a36969fd1a86f24bc7ff59611c1417df68785 Author: Andrea Cosentino <[email protected]> AuthorDate: Wed Mar 3 12:11:34 2021 +0100 CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-SNS component --- .../aws2/sns/SnsComponentConfigurationTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/components/camel-aws2-sns/src/test/java/org/apache/camel/component/aws2/sns/SnsComponentConfigurationTest.java b/components/camel-aws2-sns/src/test/java/org/apache/camel/component/aws2/sns/SnsComponentConfigurationTest.java index 74efa61..37db079 100644 --- a/components/camel-aws2-sns/src/test/java/org/apache/camel/component/aws2/sns/SnsComponentConfigurationTest.java +++ b/components/camel-aws2-sns/src/test/java/org/apache/camel/component/aws2/sns/SnsComponentConfigurationTest.java @@ -249,4 +249,20 @@ public class SnsComponentConfigurationTest extends CamelTestSupport { assertNull(endpoint.getConfiguration().getPolicy()); assertFalse(endpoint.getConfiguration().isFifoTopic()); } + + @Test + public void createEndpointWithOverride() throws Exception { + Sns2Component component = context.getComponent("aws2-sns", Sns2Component.class); + Sns2Endpoint endpoint = (Sns2Endpoint) component.createEndpoint("aws2-sns://MyTopic?accessKey=xxx&secretKey=yyy&overrideEndpoint=true&uriEndpointOverride=http://localhost:9090"); + + assertEquals("MyTopic", endpoint.getConfiguration().getTopicName()); + assertEquals("xxx", endpoint.getConfiguration().getAccessKey()); + assertEquals("yyy", endpoint.getConfiguration().getSecretKey()); + assertNull(endpoint.getConfiguration().getAmazonSNSClient()); + assertNull(endpoint.getConfiguration().getTopicArn()); + assertNull(endpoint.getConfiguration().getSubject()); + assertNull(endpoint.getConfiguration().getPolicy()); + assertTrue(endpoint.getConfiguration().isOverrideEndpoint()); + assertEquals("http://localhost:9090", endpoint.getConfiguration().getUriEndpointOverride()); + } }
