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 ac0352fad70291cde22209dd61cb1a2876ab0fe1 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Mon Mar 1 06:54:58 2021 +0100 CAMEL-16171 - Add uri-endpoint-override options to all AWS2 components - AWS2-EC2 component --- .../component/aws2/ec2/EC2ComponentConfigurationTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentConfigurationTest.java b/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentConfigurationTest.java index 4fc479d..6d74eac 100644 --- a/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentConfigurationTest.java +++ b/components/camel-aws2-ec2/src/test/java/org/apache/camel/component/aws2/ec2/EC2ComponentConfigurationTest.java @@ -26,6 +26,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; public class EC2ComponentConfigurationTest extends CamelTestSupport { @@ -135,4 +136,17 @@ public class EC2ComponentConfigurationTest extends CamelTestSupport { assertEquals("localhost", endpoint.getConfiguration().getProxyHost()); assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort()); } + + @Test + public void createEndpointWithUriOverride() throws Exception { + AWS2EC2Component component = context.getComponent("aws2-ec2", AWS2EC2Component.class); + AWS2EC2Endpoint endpoint = (AWS2EC2Endpoint) component + .createEndpoint("aws2-ec2://testDomain?accessKey=xxxxxx&secretKey=yyyyy®ion=US_EAST_1&overrideEndpoint=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()); + } }