You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2021/04/27 10:03:33 UTC
[camel-kafka-connector] branch main updated: Add autoCreateTopic to
fix AWS v2 SNS tests
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git
The following commit(s) were added to refs/heads/main by this push:
new d985fc7 Add autoCreateTopic to fix AWS v2 SNS tests
d985fc7 is described below
commit d985fc7394e85d769cca0dbc66fa35e4b8151730
Author: Otavio Rodolfo Piske <op...@redhat.com>
AuthorDate: Tue Apr 27 10:52:01 2021 +0200
Add autoCreateTopic to fix AWS v2 SNS tests
---
.../kafkaconnector/aws/v2/sns/sink/CamelAWSSNSPropertyFactory.java | 4 ++++
.../camel/kafkaconnector/aws/v2/sns/sink/CamelSinkAWSSNSITCase.java | 3 +++
2 files changed, 7 insertions(+)
diff --git a/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelAWSSNSPropertyFactory.java b/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelAWSSNSPropertyFactory.java
index 0fafbfb..7a0a0ab 100644
--- a/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelAWSSNSPropertyFactory.java
+++ b/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelAWSSNSPropertyFactory.java
@@ -65,6 +65,10 @@ final class CamelAWSSNSPropertyFactory extends SinkConnectorPropertyFactory<Came
return withAmazonConfig(amazonConfigs, this.SPRING_STYLE);
}
+ public CamelAWSSNSPropertyFactory withAutoCreateTopic(boolean value) {
+ return setProperty("camel.sink.endpoint.autoCreateTopic", value);
+ }
+
public CamelAWSSNSPropertyFactory withAmazonConfig(Properties amazonConfigs, Map<String, String> style) {
String accessKeyKey = style.get(AWSConfigs.ACCESS_KEY);
String secretKeyKey = style.get(AWSConfigs.SECRET_KEY);
diff --git a/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelSinkAWSSNSITCase.java b/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelSinkAWSSNSITCase.java
index f78fc68..fbac9b7 100644
--- a/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelSinkAWSSNSITCase.java
+++ b/tests/itests-aws-v2/src/test/java/org/apache/camel/kafkaconnector/aws/v2/sns/sink/CamelSinkAWSSNSITCase.java
@@ -125,6 +125,7 @@ public class CamelSinkAWSSNSITCase extends CamelSinkTestSupport {
.withTopics(topicName)
.withTopicOrArn(queueName)
.withSubscribeSNStoSQS(sqsQueueUrl)
+ .withAutoCreateTopic(true)
.withConfiguration(TestSnsConfiguration.class.getName())
.withAmazonConfig(amazonProperties);
@@ -143,6 +144,7 @@ public class CamelSinkAWSSNSITCase extends CamelSinkTestSupport {
.withTopics(topicName)
.withTopicOrArn(queueName)
.withSubscribeSNStoSQS(sqsQueueUrl)
+ .withAutoCreateTopic(true)
.withConfiguration(TestSnsConfiguration.class.getName())
.withAmazonConfig(amazonProperties, CamelAWSSNSPropertyFactory.KAFKA_STYLE);
@@ -164,6 +166,7 @@ public class CamelSinkAWSSNSITCase extends CamelSinkTestSupport {
.append("subscribeSNStoSQS", "true")
.append("region", amazonProperties.getProperty(AWSConfigs.REGION, Region.US_EAST_1.id()))
.append("configuration", classRef(TestSnsConfiguration.class.getName()))
+ .append("autoCreateTopic", "true")
.buildUrl();
runTest(connectorPropertyFactory, topicName, expect);