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 4320f6dadd3cc34f74234b753ad989430b2141b1 Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Tue Jan 19 08:22:55 2021 +0100 CAMEL-16054 - Added a little test for override endpoint options --- .../KinesisFirehoseComponentConfigurationTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.java b/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.java index 5b6ccfb..0387444 100644 --- a/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.java +++ b/components/camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/firehose/KinesisFirehoseComponentConfigurationTest.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 KinesisFirehoseComponentConfigurationTest extends CamelTestSupport { @@ -81,4 +82,17 @@ public class KinesisFirehoseComponentConfigurationTest extends CamelTestSupport assertEquals("localhost", endpoint.getConfiguration().getProxyHost()); assertEquals(Integer.valueOf(9000), endpoint.getConfiguration().getProxyPort()); } + + @Test + public void createEndpointWithOverride() throws Exception { + KinesisFirehose2Component component = context.getComponent("aws2-kinesis-firehose", KinesisFirehose2Component.class); + KinesisFirehose2Endpoint endpoint = (KinesisFirehose2Endpoint) component + .createEndpoint("aws2-kinesis-firehose://some_stream_name?accessKey=xxxxx&secretKey=yyyyy&overrideEndpoint=true&uriEndpointOverride=http://localhost:4567"); + + assertEquals("some_stream_name", endpoint.getConfiguration().getStreamName()); + assertEquals("xxxxx", endpoint.getConfiguration().getAccessKey()); + assertEquals("yyyyy", endpoint.getConfiguration().getSecretKey()); + assertEquals("http://localhost:4567", endpoint.getConfiguration().getUriEndpointOverride()); + assertTrue(endpoint.getConfiguration().isOverrideEndpoint()); + } }