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/03/04 12:37:15 UTC

[camel] branch master updated (2f0cc02 -> a21a95d)

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 2f0cc02  Upgrade Async http client to version 2.11.0
     new 8f62239  Camel-AWS2-CW: Migrated tests to Junit5
     new a21a95d  Camel-AWS2-CW: Fixed CS

The 2 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:
 components/camel-aws2-cw/pom.xml                   |  7 +-----
 .../aws2/cw/CwComponentConfigurationTest.java      | 25 +++++++++++++++-------
 .../aws2/cw/CwComponentRegistryClientTest.java     | 13 +++++++----
 .../camel/component/aws2/cw/CwComponentTest.java   |  4 ++--
 .../aws2/cw/CwComponentVerifierExtensionTest.java  | 11 +++++-----
 .../cw/integration/CwComponentIntegrationTest.java |  8 +++----
 6 files changed, 39 insertions(+), 29 deletions(-)


[camel] 02/02: Camel-AWS2-CW: 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 a21a95d3e406799845d8ed3ef2b3e12bd67e3c77
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 4 13:36:35 2020 +0100

    Camel-AWS2-CW: Fixed CS
---
 .../camel/component/aws2/cw/CwComponentConfigurationTest.java       | 6 +++---
 .../camel/component/aws2/cw/CwComponentRegistryClientTest.java      | 4 ++--
 .../java/org/apache/camel/component/aws2/cw/CwComponentTest.java    | 1 -
 .../camel/component/aws2/cw/CwComponentVerifierExtensionTest.java   | 1 +
 .../component/aws2/cw/integration/CwComponentIntegrationTest.java   | 1 -
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java
index 922993b..1def63d 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java
@@ -19,11 +19,11 @@ package org.apache.camel.component.aws2.cw;
 import java.time.Instant;
 
 import org.apache.camel.BindToRegistry;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
 import software.amazon.awssdk.core.Protocol;
 import software.amazon.awssdk.regions.Region;
 import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -68,7 +68,7 @@ public class CwComponentConfigurationTest extends CamelTestSupport {
     public void createEndpointWithoutSecretKeyAndAccessKeyConfiguration() throws Exception {
         Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
         assertThrows(IllegalArgumentException.class, () -> {
-        component.createEndpoint("aws2-cw://camel.apache.org/test?accessKey=xxx");
+            component.createEndpoint("aws2-cw://camel.apache.org/test?accessKey=xxx");
         });
     }
 
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
index 5055fbf..5f25dbf 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
@@ -21,8 +21,8 @@ import java.time.Instant;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
-
 import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
+
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
@@ -49,7 +49,7 @@ public class CwComponentRegistryClientTest extends CamelTestSupport {
     public void createEndpointWithMinimalS3ClientMisconfiguration() throws Exception {
         Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
         assertThrows(IllegalArgumentException.class, () -> {
-        Cw2Endpoint endpoint = (Cw2Endpoint)component.createEndpoint("aws2-cw://camel.apache.org/test");
+            Cw2Endpoint endpoint = (Cw2Endpoint)component.createEndpoint("aws2-cw://camel.apache.org/test");
         });
     }
 }
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java
index 42b622a..e76680e 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java
@@ -26,7 +26,6 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
-
 import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
 import software.amazon.awssdk.services.cloudwatch.model.StandardUnit;
 
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java
index 6073b71..69cebe4 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java
@@ -23,6 +23,7 @@ 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 CwComponentVerifierExtensionTest extends CamelTestSupport {
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java
index 5173f5d..a663bc1 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java
@@ -23,7 +23,6 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.aws2.cw.Cw2Constants;
 import org.apache.camel.component.mock.MockEndpoint;
-
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;


[camel] 01/02: Camel-AWS2-CW: Migrated tests to Junit5

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 8f622392de3348850b0350b707b5edf7d05c5987
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Mar 4 13:25:58 2020 +0100

    Camel-AWS2-CW: Migrated tests to Junit5
---
 components/camel-aws2-cw/pom.xml                   |  7 +------
 .../aws2/cw/CwComponentConfigurationTest.java      | 23 +++++++++++++++-------
 .../aws2/cw/CwComponentRegistryClientTest.java     | 11 ++++++++---
 .../camel/component/aws2/cw/CwComponentTest.java   |  5 +++--
 .../aws2/cw/CwComponentVerifierExtensionTest.java  | 10 +++++-----
 .../cw/integration/CwComponentIntegrationTest.java |  9 +++++----
 6 files changed, 38 insertions(+), 27 deletions(-)

diff --git a/components/camel-aws2-cw/pom.xml b/components/camel-aws2-cw/pom.xml
index 28fd553..30d58b4 100644
--- a/components/camel-aws2-cw/pom.xml
+++ b/components/camel-aws2-cw/pom.xml
@@ -53,13 +53,8 @@
 
         <!-- for testing -->
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test-spring</artifactId>
+            <artifactId>camel-test-spring-junit5</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java
index 6f8e169..922993b 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentConfigurationTest.java
@@ -19,11 +19,14 @@ package org.apache.camel.component.aws2.cw;
 import java.time.Instant;
 
 import org.apache.camel.BindToRegistry;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
 import software.amazon.awssdk.core.Protocol;
 import software.amazon.awssdk.regions.Region;
 import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class CwComponentConfigurationTest extends CamelTestSupport {
 
@@ -45,22 +48,28 @@ public class CwComponentConfigurationTest extends CamelTestSupport {
         assertEquals(NOW, endpoint.getConfiguration().getTimestamp());
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithoutAccessKeyConfiguration() throws Exception {
         Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
-        component.createEndpoint("aws2-cw://camel.apache.org/test?secretKey=yyy");
+        assertThrows(IllegalArgumentException.class, () -> {
+            component.createEndpoint("aws2-cw://camel.apache.org/test?secretKey=yyy");
+        });
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithoutSecretKeyConfiguration() throws Exception {
         Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
-        component.createEndpoint("aws2-cw://camel.apache.org/test?accessKey=xxx");
+        assertThrows(IllegalArgumentException.class, () -> {
+            component.createEndpoint("aws2-cw://camel.apache.org/test?accessKey=xxx");
+        });
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithoutSecretKeyAndAccessKeyConfiguration() throws Exception {
         Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
+        assertThrows(IllegalArgumentException.class, () -> {
         component.createEndpoint("aws2-cw://camel.apache.org/test?accessKey=xxx");
+        });
     }
 
     @Test
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
index 69814f1..5055fbf 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentRegistryClientTest.java
@@ -19,9 +19,12 @@ package org.apache.camel.component.aws2.cw;
 import java.time.Instant;
 
 import org.apache.camel.BindToRegistry;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
 import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class CwComponentRegistryClientTest extends CamelTestSupport {
 
@@ -42,9 +45,11 @@ public class CwComponentRegistryClientTest extends CamelTestSupport {
         assertEquals(NOW, endpoint.getConfiguration().getTimestamp());
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithMinimalS3ClientMisconfiguration() throws Exception {
         Cw2Component component = context.getComponent("aws2-cw", Cw2Component.class);
+        assertThrows(IllegalArgumentException.class, () -> {
         Cw2Endpoint endpoint = (Cw2Endpoint)component.createEndpoint("aws2-cw://camel.apache.org/test");
+        });
     }
 }
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java
index 71f202b..42b622a 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentTest.java
@@ -24,8 +24,9 @@ import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
 import software.amazon.awssdk.services.cloudwatch.CloudWatchClient;
 import software.amazon.awssdk.services.cloudwatch.model.StandardUnit;
 
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java
index ac50810..6073b71 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/CwComponentVerifierExtensionTest.java
@@ -21,9 +21,9 @@ import java.util.Map;
 
 import org.apache.camel.Component;
 import org.apache.camel.component.extension.ComponentVerifierExtension;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Assert;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CwComponentVerifierExtensionTest extends CamelTestSupport {
 
@@ -49,7 +49,7 @@ public class CwComponentVerifierExtensionTest extends CamelTestSupport {
 
         ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.PARAMETERS, parameters);
 
-        Assert.assertEquals(ComponentVerifierExtension.Result.Status.OK, result.getStatus());
+        assertEquals(ComponentVerifierExtension.Result.Status.OK, result.getStatus());
     }
 
     @Test
@@ -65,7 +65,7 @@ public class CwComponentVerifierExtensionTest extends CamelTestSupport {
 
         ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
 
-        Assert.assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
+        assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
     }
 
 }
diff --git a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java
index 34c815a..5173f5d 100644
--- a/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java
+++ b/components/camel-aws2-cw/src/test/java/org/apache/camel/component/aws2/cw/integration/CwComponentIntegrationTest.java
@@ -23,11 +23,12 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.aws2.cw.Cw2Constants;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
 
-@Ignore("Must be manually tested. Provide your own accessKey and secretKey!")
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+
+@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
 public class CwComponentIntegrationTest extends CamelTestSupport {
 
     @EndpointInject("mock:result")