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 c90e9d29f665851b370a84834651e283ce2b9f9b Author: Andrea Cosentino <[email protected]> AuthorDate: Mon Mar 1 14:49:07 2021 +0100 CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-IAM component --- .../component/aws2/iam/IAMComponentConfigurationTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMComponentConfigurationTest.java b/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMComponentConfigurationTest.java index 95349f2..b8bef5c 100644 --- a/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMComponentConfigurationTest.java +++ b/components/camel-aws2-iam/src/test/java/org/apache/camel/component/aws2/iam/IAMComponentConfigurationTest.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 IAMComponentConfigurationTest extends CamelTestSupport { @@ -67,4 +68,17 @@ public class IAMComponentConfigurationTest extends CamelTestSupport { assertEquals("localhost", endpoint.getConfiguration().getProxyHost()); assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort()); } + + @Test + public void createEndpointWithOverrideEndpoint() throws Exception { + IAM2Component component = context.getComponent("aws2-iam", IAM2Component.class); + IAM2Endpoint endpoint + = (IAM2Endpoint) component.createEndpoint("aws2-iam://label?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()); + } }
