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 2022/11/09 11:11:14 UTC

[camel] branch main updated (c74c23f39e1 -> 08b2db0c910)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from c74c23f39e1 CAMEL-18608: camel-file - Disable the test FileConsumerResumeStrategyTest
     new efb0cfab835 CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
     new 691ea75ca74 CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
     new 92b23aa3c7a CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
     new 0b6bd705408 CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
     new 08b2db0c910 CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams

The 5 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/ddbstream/Ddb2StreamComponent.java        |  2 -
 .../Ddb2StreamComponentVerifierExtension.java      | 94 ----------------------
 .../aws2/ddbstream/Ddb2StreamConsumer.java         | 21 +++++
 .../ddbstream/Ddb2StreamConsumerHealthCheck.java}  | 30 +++----
 ...StreamConsumerHealthCheckProfileCredsTest.java} | 24 +++---
 ...2StreamConsumerHealthCheckStaticCredsTest.java} | 20 ++---
 .../Ddb2StreamConsumerHealthCustomClientTest.java} | 24 +++---
 .../DdbStreamComponentVerifierExtensionTest.java   | 90 ---------------------
 8 files changed, 65 insertions(+), 240 deletions(-)
 delete mode 100644 components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentVerifierExtension.java
 copy components/camel-aws/{camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/kinesis/Kinesis2ConsumerHealthCheck.java => camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java} (73%)
 copy components/camel-aws/{camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/kinesis/Kinesis2ConsumerHealthCheckProfileCredsTest.java => camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java} (79%)
 copy components/camel-aws/{camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/kinesis/Kinesis2ConsumerHealthCheckStaticCredsTest.java => camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java} (81%)
 copy components/camel-aws/{camel-aws2-kinesis/src/test/java/org/apache/camel/component/aws2/kinesis/Kinesis2ConsumerHealthCustomClientTest.java => camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java} (79%)
 delete mode 100644 components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentVerifierExtensionTest.java


[camel] 02/05: CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 691ea75ca7400622a0cc47963fb091c41fe61ef1
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 9 11:54:00 2022 +0100

    CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../ddbstream/Ddb2StreamConsumerHealthCheck.java   |   2 +-
 ...2StreamConsumerHealthCheckProfileCredsTest.java | 107 +++++++++++++++++++++
 2 files changed, 108 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
index 9357f015b55..8f5cec8e28c 100644
--- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
+++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
@@ -34,7 +34,7 @@ public class Ddb2StreamConsumerHealthCheck extends AbstractHealthCheck {
     private final String routeId;
 
     public Ddb2StreamConsumerHealthCheck(Ddb2StreamConsumer ddb2StreamConsumer, String routeId) {
-        super("camel", "aws2-dd2-stream-consumer-" + routeId);
+        super("camel", "aws2-ddbstream-consumer-" + routeId);
         this.ddb2StreamConsumer = ddb2StreamConsumer;
         this.routeId = routeId;
     }
diff --git a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java
new file mode 100644
index 00000000000..36db874cff7
--- /dev/null
+++ b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.ddbstream;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.health.HealthCheck;
+import org.apache.camel.health.HealthCheckHelper;
+import org.apache.camel.health.HealthCheckRegistry;
+import org.apache.camel.impl.health.DefaultHealthCheckRegistry;
+import org.apache.camel.test.infra.aws.common.services.AWSService;
+import org.apache.camel.test.infra.aws2.clients.AWSSDKClientUtils;
+import org.apache.camel.test.infra.aws2.services.AWSServiceFactory;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
+
+public class Ddb2StreamConsumerHealthCheckProfileCredsTest extends CamelTestSupport {
+
+    @RegisterExtension
+    public static AWSService service = AWSServiceFactory.createS3Service();
+
+    private static final Logger LOG = LoggerFactory.getLogger(Ddb2StreamConsumerHealthCheckProfileCredsTest.class);
+
+    CamelContext context;
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        context = super.createCamelContext();
+        context.getPropertiesComponent().setLocation("ref:prop");
+        Ddb2StreamComponent component = new Ddb2StreamComponent(context);
+        component.getConfiguration().setAmazonDynamoDbStreamsClient(DynamoDbStreamsClient.builder().build());
+        component.init();
+        context.addComponent("aws2-ddbstream", component);
+
+        HealthCheckRegistry registry = new DefaultHealthCheckRegistry();
+        registry.setCamelContext(context);
+        Object hc = registry.resolveById("context");
+        registry.register(hc);
+        hc = registry.resolveById("routes");
+        registry.register(hc);
+        hc = registry.resolveById("consumers");
+        registry.register(hc);
+        context.setExtension(HealthCheckRegistry.class, registry);
+
+        return context;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+
+            @Override
+            public void configure() {
+                from("aws2-ddbstream://stream?region=l&useDefaultCredentialsProvider=true")
+                        .startupOrder(2).log("${body}").routeId("test-health-it");
+            }
+        };
+    }
+
+    @Test
+    public void testConnectivity() {
+
+        Collection<HealthCheck.Result> res = HealthCheckHelper.invokeLiveness(context);
+        boolean up = res.stream().allMatch(r -> r.getState().equals(HealthCheck.State.UP));
+        Assertions.assertTrue(up, "liveness check");
+
+        // health-check readiness should be down
+        await().atMost(20, TimeUnit.SECONDS).untilAsserted(() -> {
+            Collection<HealthCheck.Result> res2 = HealthCheckHelper.invokeReadiness(context);
+            boolean down = res2.stream().allMatch(r -> r.getState().equals(HealthCheck.State.DOWN));
+            boolean containsDdb2StreamHealthCheck = res2.stream()
+                    .filter(result -> result.getCheck().getId().startsWith("aws2-ddbstream-consumer"))
+                    .findAny()
+                    .isPresent();
+            boolean hasRegionMessage = res2.stream()
+                    .anyMatch(r -> r.getMessage().stream().anyMatch(msg -> msg.contains("region")));
+            Assertions.assertTrue(down, "liveness check");
+            Assertions.assertTrue(containsDdb2StreamHealthCheck, "aws2-ddbstream check");
+            Assertions.assertTrue(hasRegionMessage, "aws2-ddbstream check error message");
+        });
+
+    }
+}


[camel] 03/05: CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 92b23aa3c7a67b291ef3153946d5ad63677b1114
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 9 11:54:12 2022 +0100

    CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 ...b2StreamConsumerHealthCheckStaticCredsTest.java | 101 +++++++++++++++++++++
 1 file changed, 101 insertions(+)

diff --git a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java
new file mode 100644
index 00000000000..51498cf457d
--- /dev/null
+++ b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.ddbstream;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.health.HealthCheck;
+import org.apache.camel.health.HealthCheckHelper;
+import org.apache.camel.health.HealthCheckRegistry;
+import org.apache.camel.impl.health.DefaultHealthCheckRegistry;
+import org.apache.camel.test.infra.aws.common.services.AWSService;
+import org.apache.camel.test.infra.aws2.services.AWSServiceFactory;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
+
+public class Ddb2StreamConsumerHealthCheckStaticCredsTest extends CamelTestSupport {
+
+    @RegisterExtension
+    public static AWSService service = AWSServiceFactory.createS3Service();
+
+    private static final Logger LOG = LoggerFactory.getLogger(Ddb2StreamConsumerHealthCheckStaticCredsTest.class);
+
+    CamelContext context;
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        context = super.createCamelContext();
+
+        // install health check manually (yes a bit cumbersome)
+        HealthCheckRegistry registry = new DefaultHealthCheckRegistry();
+        registry.setCamelContext(context);
+        Object hc = registry.resolveById("context");
+        registry.register(hc);
+        hc = registry.resolveById("routes");
+        registry.register(hc);
+        hc = registry.resolveById("consumers");
+        registry.register(hc);
+        context.setExtension(HealthCheckRegistry.class, registry);
+
+        return context;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+
+            @Override
+            public void configure() {
+                from("aws2-ddbstream://stream?region=l&secretKey=l&accessKey=k")
+                        .startupOrder(2).log("${body}").routeId("test-health-it");
+            }
+        };
+    }
+
+    @Test
+    public void testConnectivity() {
+
+        Collection<HealthCheck.Result> res = HealthCheckHelper.invokeLiveness(context);
+        boolean up = res.stream().allMatch(r -> r.getState().equals(HealthCheck.State.UP));
+        Assertions.assertTrue(up, "liveness check");
+
+        // health-check readiness should be down
+        await().atMost(20, TimeUnit.SECONDS).untilAsserted(() -> {
+            Collection<HealthCheck.Result> res2 = HealthCheckHelper.invokeReadiness(context);
+            boolean down = res2.stream().allMatch(r -> r.getState().equals(HealthCheck.State.DOWN));
+            boolean containsKinesis2HealthCheck = res2.stream()
+                    .filter(result -> result.getCheck().getId().startsWith("aws2-ddbstream-consumer"))
+                    .findAny()
+                    .isPresent();
+            boolean hasRegionMessage = res2.stream()
+                    .anyMatch(r -> r.getMessage().stream().anyMatch(msg -> msg.contains("region")));
+            Assertions.assertTrue(down, "liveness check");
+            Assertions.assertTrue(containsKinesis2HealthCheck, "aws2-ddbstream check");
+            Assertions.assertTrue(hasRegionMessage, "aws2-ddbstream check error message");
+        });
+
+    }
+}


[camel] 04/05: CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 0b6bd7054080877eea7e2078e7c2116fa530fe3f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 9 11:54:23 2022 +0100

    CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../Ddb2StreamConsumerHealthCustomClientTest.java  | 105 +++++++++++++++++++++
 1 file changed, 105 insertions(+)

diff --git a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java
new file mode 100644
index 00000000000..b111edef014
--- /dev/null
+++ b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.ddbstream;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.health.HealthCheck;
+import org.apache.camel.health.HealthCheckHelper;
+import org.apache.camel.health.HealthCheckRegistry;
+import org.apache.camel.impl.health.DefaultHealthCheckRegistry;
+import org.apache.camel.test.infra.aws.common.services.AWSService;
+import org.apache.camel.test.infra.aws2.clients.AWSSDKClientUtils;
+import org.apache.camel.test.infra.aws2.services.AWSServiceFactory;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
+
+@DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on Apache CI")
+public class Ddb2StreamConsumerHealthCustomClientTest extends CamelTestSupport {
+
+    @RegisterExtension
+    public static AWSService service = AWSServiceFactory.createS3Service();
+
+    private static final Logger LOG = LoggerFactory.getLogger(Ddb2StreamConsumerHealthCustomClientTest.class);
+
+    CamelContext context;
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        context = super.createCamelContext();
+        context.getRegistry().bind("ddbClient", DynamoDbStreamsClient.builder().build());
+
+        HealthCheckRegistry registry = new DefaultHealthCheckRegistry();
+        registry.setCamelContext(context);
+        Object hc = registry.resolveById("context");
+        registry.register(hc);
+        hc = registry.resolveById("routes");
+        registry.register(hc);
+        hc = registry.resolveById("consumers");
+        registry.register(hc);
+        context.setExtension(HealthCheckRegistry.class, registry);
+
+        return context;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+
+            @Override
+            public void configure() {
+                from("aws2-ddbstream://stream")
+                        .startupOrder(2).log("${body}").routeId("test-health-it");
+            }
+        };
+    }
+
+    @Test
+    public void testConnectivity() {
+
+        Collection<HealthCheck.Result> res = HealthCheckHelper.invokeLiveness(context);
+        boolean up = res.stream().allMatch(r -> r.getState().equals(HealthCheck.State.UP));
+        Assertions.assertTrue(up, "liveness check");
+
+        // health-check readiness should be down
+        await().atMost(20, TimeUnit.SECONDS).untilAsserted(() -> {
+            Collection<HealthCheck.Result> res2 = HealthCheckHelper.invokeReadiness(context);
+            boolean down = res2.stream().allMatch(r -> r.getState().equals(HealthCheck.State.DOWN));
+            boolean containsAws2DdbStreamHealthCheck = res2.stream()
+                    .filter(result -> result.getCheck().getId().startsWith("aws2-ddbstream-consumer"))
+                    .findAny()
+                    .isPresent();
+            boolean hasRegionMessage = res2.stream()
+                    .anyMatch(r -> r.getMessage().stream().anyMatch(msg -> msg.contains("region")));
+            Assertions.assertTrue(down, "liveness check");
+            Assertions.assertTrue(containsAws2DdbStreamHealthCheck, "aws2-ddbstream check");
+            Assertions.assertFalse(hasRegionMessage, "aws2-ddbstream check error message");
+        });
+
+    }
+}


[camel] 05/05: CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 08b2db0c910c6ef3665ba266d563788481dc5ac4
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 9 11:56:23 2022 +0100

    CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java    | 4 ++--
 .../ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java   | 7 +++----
 .../ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java    | 6 +++---
 .../aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java   | 7 +++----
 4 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
index 8f5cec8e28c..6a9d727bc96 100644
--- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
+++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.aws2.ddbstream;
 
+import java.util.Map;
+
 import org.apache.camel.health.HealthCheckResultBuilder;
 import org.apache.camel.impl.health.AbstractHealthCheck;
 import org.apache.camel.util.ObjectHelper;
@@ -26,8 +28,6 @@ import software.amazon.awssdk.regions.Region;
 import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
 import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClientBuilder;
 
-import java.util.Map;
-
 public class Ddb2StreamConsumerHealthCheck extends AbstractHealthCheck {
 
     private final Ddb2StreamConsumer ddb2StreamConsumer;
diff --git a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java
index 36db874cff7..3d5dd9866c1 100644
--- a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java
+++ b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckProfileCredsTest.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.aws2.ddbstream;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
@@ -23,7 +26,6 @@ import org.apache.camel.health.HealthCheckHelper;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.impl.health.DefaultHealthCheckRegistry;
 import org.apache.camel.test.infra.aws.common.services.AWSService;
-import org.apache.camel.test.infra.aws2.clients.AWSSDKClientUtils;
 import org.apache.camel.test.infra.aws2.services.AWSServiceFactory;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Assertions;
@@ -33,9 +35,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
 
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
 public class Ddb2StreamConsumerHealthCheckProfileCredsTest extends CamelTestSupport {
diff --git a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java
index 51498cf457d..e4da968fceb 100644
--- a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java
+++ b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheckStaticCredsTest.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.aws2.ddbstream;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
@@ -31,9 +34,6 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
 public class Ddb2StreamConsumerHealthCheckStaticCredsTest extends CamelTestSupport {
diff --git a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java
index b111edef014..7a4f9b7410e 100644
--- a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java
+++ b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCustomClientTest.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.aws2.ddbstream;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
@@ -23,7 +26,6 @@ import org.apache.camel.health.HealthCheckHelper;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.impl.health.DefaultHealthCheckRegistry;
 import org.apache.camel.test.infra.aws.common.services.AWSService;
-import org.apache.camel.test.infra.aws2.clients.AWSSDKClientUtils;
 import org.apache.camel.test.infra.aws2.services.AWSServiceFactory;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Assertions;
@@ -34,9 +36,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
 
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
 @DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on Apache CI")


[camel] 01/05: CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit efb0cfab8352832424c3638e187aa460d47aa37f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Nov 9 11:37:57 2022 +0100

    CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - DynamoDB Streams
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../aws2/ddbstream/Ddb2StreamComponent.java        |  2 -
 .../Ddb2StreamComponentVerifierExtension.java      | 94 ---------------------
 .../aws2/ddbstream/Ddb2StreamConsumer.java         | 21 +++++
 .../ddbstream/Ddb2StreamConsumerHealthCheck.java   | 96 ++++++++++++++++++++++
 .../DdbStreamComponentVerifierExtensionTest.java   | 90 --------------------
 5 files changed, 117 insertions(+), 186 deletions(-)

diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
index dab1869eb4f..ea9c73850bf 100644
--- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
+++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponent.java
@@ -40,8 +40,6 @@ public class Ddb2StreamComponent extends DefaultComponent {
 
     public Ddb2StreamComponent(CamelContext context) {
         super(context);
-
-        registerExtension(new Ddb2StreamComponentVerifierExtension());
     }
 
     @Override
diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentVerifierExtension.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentVerifierExtension.java
deleted file mode 100644
index e7da3cac1c8..00000000000
--- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamComponentVerifierExtension.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.aws2.ddbstream;
-
-import java.util.Map;
-
-import org.apache.camel.component.extension.verifier.DefaultComponentVerifierExtension;
-import org.apache.camel.component.extension.verifier.ResultBuilder;
-import org.apache.camel.component.extension.verifier.ResultErrorBuilder;
-import org.apache.camel.component.extension.verifier.ResultErrorHelper;
-import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
-import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
-import software.amazon.awssdk.core.exception.SdkClientException;
-import software.amazon.awssdk.regions.Region;
-import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
-import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClientBuilder;
-
-public class Ddb2StreamComponentVerifierExtension extends DefaultComponentVerifierExtension {
-
-    public Ddb2StreamComponentVerifierExtension() {
-        this("aws2-ddbstream");
-    }
-
-    public Ddb2StreamComponentVerifierExtension(String scheme) {
-        super(scheme);
-    }
-
-    // *********************************
-    // Parameters validation
-    // *********************************
-
-    @Override
-    protected Result verifyParameters(Map<String, Object> parameters) {
-
-        ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS)
-                .error(ResultErrorHelper.requiresOption("accessKey", parameters))
-                .error(ResultErrorHelper.requiresOption("secretKey", parameters))
-                .error(ResultErrorHelper.requiresOption("region", parameters));
-
-        // Validate using the catalog
-
-        super.verifyParametersAgainstCatalog(builder, parameters);
-
-        return builder.build();
-    }
-
-    // *********************************
-    // Connectivity validation
-    // *********************************
-
-    @Override
-    protected Result verifyConnectivity(Map<String, Object> parameters) {
-        ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY);
-
-        try {
-            Ddb2StreamConfiguration configuration = setProperties(new Ddb2StreamConfiguration(), parameters);
-            if (!DynamoDbStreamsClient.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());
-            DynamoDbStreamsClientBuilder clientBuilder = DynamoDbStreamsClient.builder();
-            DynamoDbStreamsClient client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred))
-                    .region(Region.of(configuration.getRegion())).build();
-            client.listStreams();
-        } catch (SdkClientException e) {
-            ResultErrorBuilder errorBuilder
-                    = ResultErrorBuilder.withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION, e.getMessage())
-                            .detail("aws_ddb_stream_exception_message", e.getMessage())
-                            .detail(VerificationError.ExceptionAttribute.EXCEPTION_CLASS, e.getClass().getName())
-                            .detail(VerificationError.ExceptionAttribute.EXCEPTION_INSTANCE, e);
-
-            builder.error(errorBuilder.build());
-        } catch (Exception e) {
-            builder.error(ResultErrorBuilder.withException(e).build());
-        }
-        return builder.build();
-    }
-}
diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumer.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumer.java
index 25044fc7b87..5b9d6c6fdea 100644
--- a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumer.java
+++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumer.java
@@ -26,6 +26,8 @@ import java.util.Queue;
 import org.apache.camel.AsyncCallback;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
+import org.apache.camel.health.HealthCheckHelper;
+import org.apache.camel.health.WritableHealthCheckRepository;
 import org.apache.camel.support.ScheduledBatchPollingConsumer;
 import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
@@ -43,6 +45,10 @@ public class Ddb2StreamConsumer extends ScheduledBatchPollingConsumer {
     private final ShardIteratorHandler shardIteratorHandler;
     private final Map<String, String> lastSeenSequenceNumbers = new HashMap<>();
 
+    private WritableHealthCheckRepository healthCheckRepository;
+
+    private Ddb2StreamConsumerHealthCheck consumerHealthCheck;
+
     public Ddb2StreamConsumer(Ddb2StreamEndpoint endpoint, Processor processor) {
         this(endpoint, processor, new ShardIteratorHandler(endpoint));
     }
@@ -106,6 +112,21 @@ public class Ddb2StreamConsumer extends ScheduledBatchPollingConsumer {
         return processedExchanges;
     }
 
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+
+        healthCheckRepository = HealthCheckHelper.getHealthCheckRepository(
+                getEndpoint().getCamelContext(),
+                "components",
+                WritableHealthCheckRepository.class);
+
+        if (healthCheckRepository != null) {
+            consumerHealthCheck = new Ddb2StreamConsumerHealthCheck(this, getRouteId());
+            healthCheckRepository.addHealthCheck(consumerHealthCheck);
+        }
+    }
+
     protected Exchange createExchange(Record record) {
         Exchange ex = createExchange(true);
         ex.getIn().setBody(record, Record.class);
diff --git a/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
new file mode 100644
index 00000000000..9357f015b55
--- /dev/null
+++ b/components/camel-aws/camel-aws2-ddb/src/main/java/org/apache/camel/component/aws2/ddbstream/Ddb2StreamConsumerHealthCheck.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.aws2.ddbstream;
+
+import org.apache.camel.health.HealthCheckResultBuilder;
+import org.apache.camel.impl.health.AbstractHealthCheck;
+import org.apache.camel.util.ObjectHelper;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClient;
+import software.amazon.awssdk.services.dynamodb.streams.DynamoDbStreamsClientBuilder;
+
+import java.util.Map;
+
+public class Ddb2StreamConsumerHealthCheck extends AbstractHealthCheck {
+
+    private final Ddb2StreamConsumer ddb2StreamConsumer;
+    private final String routeId;
+
+    public Ddb2StreamConsumerHealthCheck(Ddb2StreamConsumer ddb2StreamConsumer, String routeId) {
+        super("camel", "aws2-dd2-stream-consumer-" + routeId);
+        this.ddb2StreamConsumer = ddb2StreamConsumer;
+        this.routeId = routeId;
+    }
+
+    @Override
+    public boolean isLiveness() {
+        // this health check is only readiness
+        return false;
+    }
+
+    @Override
+    protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> options) {
+
+        try {
+            Ddb2StreamConfiguration configuration = ddb2StreamConsumer.getEndpoint().getConfiguration();
+            if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+                if (!DynamoDbStreamsClient.serviceMetadata().regions().contains(Region.of(configuration.getRegion()))) {
+                    builder.message("The service is not supported in this region");
+                    builder.down();
+                    return;
+                }
+            }
+            DynamoDbStreamsClient client;
+            if (!configuration.isUseDefaultCredentialsProvider()) {
+                AwsBasicCredentials cred
+                        = AwsBasicCredentials.create(configuration.getAccessKey(), configuration.getSecretKey());
+                DynamoDbStreamsClientBuilder clientBuilder = DynamoDbStreamsClient.builder();
+                client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred))
+                        .region(Region.of(configuration.getRegion())).build();
+            } else if (ObjectHelper.isNotEmpty(configuration.getAmazonDynamoDbStreamsClient())) {
+                client = configuration.getAmazonDynamoDbStreamsClient();
+            } else {
+                DynamoDbStreamsClientBuilder clientBuilder = DynamoDbStreamsClient.builder();
+                client = clientBuilder.region(Region.of(configuration.getRegion())).build();
+            }
+            client.listStreams();
+        } catch (AwsServiceException e) {
+            builder.message(e.getMessage());
+            builder.error(e);
+            if (ObjectHelper.isNotEmpty(e.statusCode())) {
+                builder.detail(SERVICE_STATUS_CODE, e.statusCode());
+            }
+            if (ObjectHelper.isNotEmpty(e.awsErrorDetails().errorCode())) {
+                builder.detail(SERVICE_ERROR_CODE, e.awsErrorDetails().errorCode());
+            }
+            builder.down();
+            return;
+
+        } catch (Exception e) {
+            builder.error(e);
+            builder.down();
+            return;
+        }
+
+        builder.up();
+
+    }
+
+}
diff --git a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentVerifierExtensionTest.java b/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentVerifierExtensionTest.java
deleted file mode 100644
index 81c4510452c..00000000000
--- a/components/camel-aws/camel-aws2-ddb/src/test/java/org/apache/camel/component/aws2/ddbstream/DdbStreamComponentVerifierExtensionTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.aws2.ddbstream;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Component;
-import org.apache.camel.component.extension.ComponentVerifierExtension;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class DdbStreamComponentVerifierExtensionTest extends CamelTestSupport {
-
-    // *************************************************
-    // Tests (parameters)
-    // *************************************************
-    @Override
-    public boolean isUseRouteBuilder() {
-        return false;
-    }
-
-    @Test
-    public void testParameters() {
-        Component component = context().getComponent("aws2-ddbstream");
-
-        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("tableName", "test");
-
-        ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.PARAMETERS, parameters);
-
-        assertEquals(ComponentVerifierExtension.Result.Status.OK, result.getStatus());
-    }
-
-    @Test
-    public void testConnectivity() {
-        Component component = context().getComponent("aws2-ddbstream");
-        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", "US_EAST_1");
-        parameters.put("tableName", "test");
-
-        ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
-
-        assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
-    }
-
-    @Test
-    public void testConnectivityAndRegion() {
-        Component component = context().getComponent("aws2-ddbstream");
-        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("tableName", "test");
-
-        ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
-
-        assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
-    }
-}