You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/04/08 06:10:16 UTC
[camel] branch master updated (553b73a -> 1e0fb9b2)
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.
from 553b73a CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to check if a particular service works on a specified region, Fixed CS
new f040ec7 CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to check if a particular service works on a specified region, MSK
new c09889d CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to check if a particular service works on a specified region, Added test for MSK
new 1e0fb9b2 CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to check if a particular service works on a specified region, Fixed CS
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../aws2/msk/MSK2ComponentVerifierExtension.java | 4 ++++
.../aws2/msk/MSKComponentVerifierExtensionTest.java | 16 ++++++++++++++++
2 files changed, 20 insertions(+)
[camel] 02/03: CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to
check if a particular service works on a specified region,
Added test for MSK
Posted by ac...@apache.org.
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 c09889d6377c5aefeb3fe251d31113fa961b7f9b
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Apr 8 08:06:54 2020 +0200
CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to check if a particular service works on a specified region, Added test for MSK
---
.../aws2/msk/MSKComponentVerifierExtensionTest.java | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentVerifierExtensionTest.java b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentVerifierExtensionTest.java
index 4b6098b..a7d06e4 100644
--- a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentVerifierExtensionTest.java
+++ b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentVerifierExtensionTest.java
@@ -71,4 +71,20 @@ public class MSKComponentVerifierExtensionTest extends CamelTestSupport {
assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
}
+ @Test
+ public void testConnectivityAndRegion() throws Exception {
+ Component component = context().getComponent("aws2-msk");
+ ComponentVerifierExtension verifier = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
+
+ Map<String, Object> parameters = new HashMap<>();
+ parameters.put("secretKey", "l");
+ parameters.put("accessKey", "k");
+ parameters.put("region", "l");
+ parameters.put("label", "test");
+ parameters.put("operation", MSK2Operations.listClusters);
+
+ ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
+
+ assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
+ }
}
[camel] 01/03: CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to
check if a particular service works on a specified region, MSK
Posted by ac...@apache.org.
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 f040ec7b5d2992a31f11cc5255c64be7c6ffc7a4
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Apr 8 08:05:40 2020 +0200
CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to check if a particular service works on a specified region, MSK
---
.../camel/component/aws2/msk/MSK2ComponentVerifierExtension.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java
index b1d227a..7c55b95 100644
--- a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java
+++ b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.aws2.msk;
import java.util.Map;
+import org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError;
import org.apache.camel.component.extension.verifier.DefaultComponentVerifierExtension;
import org.apache.camel.component.extension.verifier.ResultBuilder;
import org.apache.camel.component.extension.verifier.ResultErrorBuilder;
@@ -67,6 +68,10 @@ public class MSK2ComponentVerifierExtension extends DefaultComponentVerifierExte
try {
MSK2Configuration configuration = setProperties(new MSK2Configuration(), parameters);
+ if (!KafkaClient.serviceMetadata().regions().contains(Region.of(configuration.getRegion()))) {
+ ResultErrorBuilder errorBuilder = ResultErrorBuilder.withCodeAndDescription(VerificationError.StandardCode.ILLEGAL_PARAMETER, "The service is not supported in this region");
+ return builder.error(errorBuilder.build()).build();
+ }
AwsBasicCredentials cred = AwsBasicCredentials.create(configuration.getAccessKey(), configuration.getSecretKey());
KafkaClientBuilder clientBuilder = KafkaClient.builder();
KafkaClient client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred)).region(Region.of(configuration.getRegion())).build();
[camel] 03/03: CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to
check if a particular service works on a specified region, Fixed CS
Posted by ac...@apache.org.
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 1e0fb9b2d3194025ded3bdbc0d9928e26ef952fa
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Apr 8 08:07:26 2020 +0200
CAMEL-14850 - Camel-AWS2-*: Improve the verifiers to check if a particular service works on a specified region, Fixed CS
---
.../apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java
index 7c55b95..50bd010d 100644
--- a/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java
+++ b/components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2ComponentVerifierExtension.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.aws2.msk;
import java.util.Map;
-import org.apache.camel.component.extension.ComponentVerifierExtension.VerificationError;
import org.apache.camel.component.extension.verifier.DefaultComponentVerifierExtension;
import org.apache.camel.component.extension.verifier.ResultBuilder;
import org.apache.camel.component.extension.verifier.ResultErrorBuilder;