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/13 09:46:11 UTC

[camel] branch master updated (17ffa62 -> e1091e9)

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 17ffa62  Camel-AWS2-MSK: Migrated tests to Junit5
     new 8ebb600  Camel-AWS2-SES: Migrated tests to Junit5
     new e1091e9  Camel-AWS2-SES: 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-ses/pom.xml                  |  7 +----
 .../aws2/ses/SESComponentClientRegistryTest.java   | 13 +++++---
 .../aws2/ses/SesComponentConfigurationTest.java    | 35 +++++++++++++++-------
 .../component/aws2/ses/SesComponentSpringTest.java | 11 ++++---
 .../camel/component/aws2/ses/SesComponentTest.java |  7 +++--
 .../ses/SesComponentVerifierExtensionTest.java     | 11 +++----
 .../integration/SesComponentIntegrationTest.java   | 10 ++++---
 7 files changed, 59 insertions(+), 35 deletions(-)


[camel] 02/02: Camel-AWS2-SES: 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 e1091e9c32197827b27fd7952d1c87e4877a1427
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 13 10:45:44 2020 +0100

    Camel-AWS2-SES: Fixed CS
---
 .../java/org/apache/camel/component/aws2/ses/SesComponentTest.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
index 2323b73..138c8f2 100644
--- a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
+++ b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
@@ -25,12 +25,11 @@ import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit5.CamelTestSupport;
 import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.services.ses.model.SendEmailRequest;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
-import software.amazon.awssdk.services.ses.model.SendEmailRequest;
-
 public class SesComponentTest extends CamelTestSupport {
 
     @BindToRegistry("amazonSESClient")


[camel] 01/02: Camel-AWS2-SES: 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 8ebb6003d6979ac3ba4be70cd5a1b32c2995c150
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Mar 13 10:43:19 2020 +0100

    Camel-AWS2-SES: Migrated tests to Junit5
---
 components/camel-aws2-ses/pom.xml                  |  7 +----
 .../aws2/ses/SESComponentClientRegistryTest.java   | 13 +++++---
 .../aws2/ses/SesComponentConfigurationTest.java    | 35 +++++++++++++++-------
 .../component/aws2/ses/SesComponentSpringTest.java | 11 ++++---
 .../camel/component/aws2/ses/SesComponentTest.java |  8 +++--
 .../ses/SesComponentVerifierExtensionTest.java     | 11 +++----
 .../integration/SesComponentIntegrationTest.java   | 10 ++++---
 7 files changed, 60 insertions(+), 35 deletions(-)

diff --git a/components/camel-aws2-ses/pom.xml b/components/camel-aws2-ses/pom.xml
index 8254c6f..e5ed0ab 100644
--- a/components/camel-aws2-ses/pom.xml
+++ b/components/camel-aws2-ses/pom.xml
@@ -58,13 +58,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-ses/src/test/java/org/apache/camel/component/aws2/ses/SESComponentClientRegistryTest.java b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SESComponentClientRegistryTest.java
index d76a2ae..047ba09 100644
--- a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SESComponentClientRegistryTest.java
+++ b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SESComponentClientRegistryTest.java
@@ -16,8 +16,11 @@
  */
 package org.apache.camel.component.aws2.ses;
 
-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 static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class SESComponentClientRegistryTest extends CamelTestSupport {
 
@@ -32,10 +35,12 @@ public class SESComponentClientRegistryTest extends CamelTestSupport {
         assertNotNull(endpoint.getConfiguration().getAmazonSESClient());
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithMinimalSESClientMisconfiguration() throws Exception {
 
         Ses2Component component = new Ses2Component(context);
-        Ses2Endpoint endpoint = (Ses2Endpoint)component.createEndpoint("aws-ses://from@example.com");
+        assertThrows(IllegalArgumentException.class, () -> {
+            Ses2Endpoint endpoint = (Ses2Endpoint)component.createEndpoint("aws-ses://from@example.com");
+        });
     }
 }
diff --git a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
index 8da40e3..d7b9351 100644
--- a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
+++ b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentConfigurationTest.java
@@ -19,11 +19,18 @@ package org.apache.camel.component.aws2.ses;
 import java.util.ArrayList;
 import java.util.List;
 
-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.core.Protocol;
 import software.amazon.awssdk.regions.Region;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 public class SesComponentConfigurationTest extends CamelTestSupport {
 
     @Test
@@ -111,28 +118,36 @@ public class SesComponentConfigurationTest extends CamelTestSupport {
         assertTrue(endpoint.getConfiguration().getReplyToAddresses().contains("replyTo2@example.com"));
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithoutSourceName() throws Exception {
         Ses2Component component = context.getComponent("aws2-ses", Ses2Component.class);
-        component.createEndpoint("aws2-ses:// ");
+        assertThrows(IllegalArgumentException.class, () -> {
+            component.createEndpoint("aws2-ses:// ");
+        });
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithoutAmazonSESClientConfiguration() throws Exception {
         Ses2Component component = context.getComponent("aws2-ses", Ses2Component.class);
-        component.createEndpoint("aws2-ses://from@example.com");
+        assertThrows(IllegalArgumentException.class, () -> {
+            component.createEndpoint("aws2-ses://from@example.com");
+        });
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithoutAccessKeyConfiguration() throws Exception {
         Ses2Component component = context.getComponent("aws2-ses", Ses2Component.class);
-        component.createEndpoint("aws2-ses://from@example.com?secretKey=yyy");
+        assertThrows(IllegalArgumentException.class, () -> {
+            component.createEndpoint("aws2-ses://from@example.com?secretKey=yyy");
+        });
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithoutSecretKeyConfiguration() throws Exception {
         Ses2Component component = context.getComponent("aws2-ses", Ses2Component.class);
-        component.createEndpoint("aws2-ses://from@example.com?accessKey=xxx");
+        assertThrows(IllegalArgumentException.class, () -> {
+            component.createEndpoint("aws2-ses://from@example.com?accessKey=xxx");
+        });
     }
 
     @Test
diff --git a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
index 4f2b461..01e5300 100644
--- a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
+++ b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentSpringTest.java
@@ -21,20 +21,23 @@ import java.util.List;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Before;
-import org.junit.Test;
+import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 import software.amazon.awssdk.services.ses.model.SendEmailRequest;
 import software.amazon.awssdk.services.ses.model.SendRawEmailRequest;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 public class SesComponentSpringTest extends CamelSpringTestSupport {
 
     private AmazonSESClientMock sesClient;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         super.setUp();
 
diff --git a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
index df78663..2323b73 100644
--- a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
+++ b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentTest.java
@@ -23,8 +23,12 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-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 static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 import software.amazon.awssdk.services.ses.model.SendEmailRequest;
 
 public class SesComponentTest extends CamelTestSupport {
diff --git a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentVerifierExtensionTest.java b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentVerifierExtensionTest.java
index 67e3447..97d9fe2 100644
--- a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentVerifierExtensionTest.java
+++ b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/SesComponentVerifierExtensionTest.java
@@ -21,9 +21,10 @@ 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 SesComponentVerifierExtensionTest extends CamelTestSupport {
 
@@ -49,7 +50,7 @@ public class SesComponentVerifierExtensionTest 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 +66,7 @@ public class SesComponentVerifierExtensionTest 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-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentIntegrationTest.java b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentIntegrationTest.java
index 58a0499..6101fef 100644
--- a/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentIntegrationTest.java
+++ b/components/camel-aws2-ses/src/test/java/org/apache/camel/component/aws2/ses/integration/SesComponentIntegrationTest.java
@@ -23,11 +23,13 @@ import org.apache.camel.ExchangePattern;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.aws2.ses.Ses2Constants;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
-@Ignore("Must be manually tested. Provide your own accessKey and secretKey!")
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+@Disabled("Must be manually tested. Provide your own accessKey and secretKey!")
 public class SesComponentIntegrationTest extends CamelTestSupport {
 
     @Test