camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [camel] branch master updated: Camel-AWS2-MSK: Migrated tests to Junit5
Date Fri, 13 Mar 2020 09:25:20 GMT
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


The following commit(s) were added to refs/heads/master by this push:
     new 17ffa62  Camel-AWS2-MSK: Migrated tests to Junit5
17ffa62 is described below

commit 17ffa62130bb35a5be99bfd851172dfc7056d173
Author: Andrea Cosentino <ancosen@gmail.com>
AuthorDate: Fri Mar 13 10:24:52 2020 +0100

    Camel-AWS2-MSK: Migrated tests to Junit5
---
 components/camel-aws2-msk/pom.xml                           |  7 +------
 .../component/aws2/msk/MSKComponentClientRegistryTest.java  | 13 +++++++++----
 .../component/aws2/msk/MSKComponentConfigurationTest.java   |  6 ++++--
 .../aws2/msk/MSKComponentVerifierExtensionTest.java         | 11 ++++++-----
 .../camel/component/aws2/msk/MSKProducerSpringTest.java     |  6 ++++--
 .../apache/camel/component/aws2/msk/MSKProducerTest.java    |  6 ++++--
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/components/camel-aws2-msk/pom.xml b/components/camel-aws2-msk/pom.xml
index bb8087b..9d038d1 100644
--- a/components/camel-aws2-msk/pom.xml
+++ b/components/camel-aws2-msk/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-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java
b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java
index 13038cb..4755fcc 100644
--- a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java
+++ b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentClientRegistryTest.java
@@ -16,8 +16,11 @@
  */
 package org.apache.camel.component.aws2.msk;
 
-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 MSKComponentClientRegistryTest extends CamelTestSupport {
 
@@ -32,10 +35,12 @@ public class MSKComponentClientRegistryTest extends CamelTestSupport {
         assertNotNull(endpoint.getConfiguration().getMskClient());
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void createEndpointWithMinimalMSKClientMisconfiguration() throws Exception {
 
         MSK2Component component = context.getComponent("aws2-msk", MSK2Component.class);
-        MSK2Endpoint endpoint = (MSK2Endpoint)component.createEndpoint("aws2-msk://label");
+        assertThrows(IllegalArgumentException.class, () -> {
+            MSK2Endpoint endpoint = (MSK2Endpoint)component.createEndpoint("aws2-msk://label");
+        });
     }
 }
diff --git a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentConfigurationTest.java
b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentConfigurationTest.java
index 16ebbe8..45763fc 100644
--- a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentConfigurationTest.java
+++ b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKComponentConfigurationTest.java
@@ -16,11 +16,13 @@
  */
 package org.apache.camel.component.aws2.msk;
 
-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;
+
 public class MSKComponentConfigurationTest extends CamelTestSupport {
 
     @Test
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 f0e9a04..4b6098b 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
@@ -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 MSKComponentVerifierExtensionTest extends CamelTestSupport {
 
@@ -50,7 +51,7 @@ public class MSKComponentVerifierExtensionTest 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
@@ -67,7 +68,7 @@ public class MSKComponentVerifierExtensionTest 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-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerSpringTest.java
b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerSpringTest.java
index 2ef7bee..a3c4276 100644
--- a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerSpringTest.java
+++ b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerSpringTest.java
@@ -20,8 +20,8 @@ import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Test;
+import org.apache.camel.test.spring.junit5.CamelSpringTestSupport;
+import org.junit.jupiter.api.Test;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 import software.amazon.awssdk.services.kafka.model.BrokerNodeGroupInfo;
 import software.amazon.awssdk.services.kafka.model.ClusterState;
@@ -30,6 +30,8 @@ import software.amazon.awssdk.services.kafka.model.DeleteClusterResponse;
 import software.amazon.awssdk.services.kafka.model.DescribeClusterResponse;
 import software.amazon.awssdk.services.kafka.model.ListClustersResponse;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 public class MSKProducerSpringTest extends CamelSpringTestSupport {
 
     @EndpointInject("mock:result")
diff --git a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerTest.java
b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerTest.java
index 7ac02db..138bf18 100644
--- a/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerTest.java
+++ b/components/camel-aws2-msk/src/test/java/org/apache/camel/component/aws2/msk/MSKProducerTest.java
@@ -22,8 +22,8 @@ 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.kafka.model.BrokerNodeGroupInfo;
 import software.amazon.awssdk.services.kafka.model.ClusterState;
 import software.amazon.awssdk.services.kafka.model.CreateClusterResponse;
@@ -31,6 +31,8 @@ import software.amazon.awssdk.services.kafka.model.DeleteClusterResponse;
 import software.amazon.awssdk.services.kafka.model.DescribeClusterResponse;
 import software.amazon.awssdk.services.kafka.model.ListClustersResponse;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 public class MSKProducerTest extends CamelTestSupport {
 
     @BindToRegistry("amazonMskClient")


Mime
View raw message