You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2020/07/27 15:38:48 UTC

[camel] 01/43: [CAMEL-11807] Upgrade camel-workday to junit5

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

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

commit 006893a9951baf7936e8fba987f42354f35e78a2
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Mon Jul 27 09:54:35 2020 +0200

    [CAMEL-11807] Upgrade camel-workday to junit5
---
 components/camel-workday/pom.xml                      |  6 +++---
 .../apache/camel/WorkdayCommonAPIProducerTest.java    | 19 ++++++++++++-------
 .../org/apache/camel/WorkdayReportProducerTest.java   |  9 ++++++---
 3 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/components/camel-workday/pom.xml b/components/camel-workday/pom.xml
index 6fd6d58..de09a97 100644
--- a/components/camel-workday/pom.xml
+++ b/components/camel-workday/pom.xml
@@ -61,12 +61,12 @@
     <!-- testing -->
     <dependency>
       <groupId>org.apache.camel</groupId>
-      <artifactId>camel-test</artifactId>
+      <artifactId>camel-test-junit5</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+            <artifactId>junit-jupiter</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
diff --git a/components/camel-workday/src/test/java/org/apache/camel/WorkdayCommonAPIProducerTest.java b/components/camel-workday/src/test/java/org/apache/camel/WorkdayCommonAPIProducerTest.java
index 3d12e84..44ab6e1 100644
--- a/components/camel-workday/src/test/java/org/apache/camel/WorkdayCommonAPIProducerTest.java
+++ b/components/camel-workday/src/test/java/org/apache/camel/WorkdayCommonAPIProducerTest.java
@@ -22,8 +22,12 @@ import org.apache.camel.component.workday.WorkdayComponent;
 import org.apache.camel.component.workday.WorkdayConfiguration;
 import org.apache.camel.component.workday.WorkdayEndpoint;
 import org.apache.camel.component.workday.producer.WorkdayCommonAPIProducer;
-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.assertThrows;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class WorkdayCommonAPIProducerTest extends CamelTestSupport {
 
@@ -62,7 +66,7 @@ public class WorkdayCommonAPIProducerTest extends CamelTestSupport {
             return;
         }
 
-        assertTrue("Required parameters validation failed.", false);
+        fail("Required parameters validation failed.");
     }
 
     @Test
@@ -86,7 +90,7 @@ public class WorkdayCommonAPIProducerTest extends CamelTestSupport {
             return;
         }
 
-        assertTrue("Required parameters validation failed.", false);
+        fail("Required parameters validation failed.");
     }
 
     @Test
@@ -121,7 +125,7 @@ public class WorkdayCommonAPIProducerTest extends CamelTestSupport {
         assertEquals(workdayUri, "https://impl.workday.com/ccx/api/v1/camel/workers/4ab56f4b34c4b4a2be3e4f5a732c2343/paySlips/4ab56f4c39c4b4a2bf3e4f5a732c2343");
     }
 
-    @Test(expected = Test.None.class /* no exception expected */)
+    @Test
     public void createProducerCurrenciesValidConfiguration() throws Exception {
         WorkdayComponent workdayComponent = context.getComponent("workday", WorkdayComponent.class);
 
@@ -135,7 +139,7 @@ public class WorkdayCommonAPIProducerTest extends CamelTestSupport {
         workdayProducer.prepareUri(workdayEndpoint.getWorkdayConfiguration());
     }
 
-    @Test(expected = MalformedURLException.class /* no exception expected */)
+    @Test
     public void createProducerCurrenciesInvalidIDConfiguration() throws Exception {
         WorkdayComponent workdayComponent = context.getComponent("workday", WorkdayComponent.class);
 
@@ -146,7 +150,8 @@ public class WorkdayCommonAPIProducerTest extends CamelTestSupport {
 
         WorkdayCommonAPIProducer workdayProducer = new WorkdayCommonAPIProducer(workdayEndpoint);
 
-        workdayProducer.prepareUri(workdayEndpoint.getWorkdayConfiguration());
+        assertThrows(MalformedURLException.class,
+            () -> workdayProducer.prepareUri(workdayEndpoint.getWorkdayConfiguration()));
     }
 }
 
diff --git a/components/camel-workday/src/test/java/org/apache/camel/WorkdayReportProducerTest.java b/components/camel-workday/src/test/java/org/apache/camel/WorkdayReportProducerTest.java
index 776c94f..20643bc 100644
--- a/components/camel-workday/src/test/java/org/apache/camel/WorkdayReportProducerTest.java
+++ b/components/camel-workday/src/test/java/org/apache/camel/WorkdayReportProducerTest.java
@@ -20,8 +20,11 @@ import org.apache.camel.component.workday.WorkdayComponent;
 import org.apache.camel.component.workday.WorkdayConfiguration;
 import org.apache.camel.component.workday.WorkdayEndpoint;
 import org.apache.camel.component.workday.producer.WorkdayReportProducer;
-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.fail;
 
 public class WorkdayReportProducerTest extends CamelTestSupport {
 
@@ -60,7 +63,7 @@ public class WorkdayReportProducerTest extends CamelTestSupport {
             return;
         }
 
-        assertTrue("Required parameters validation failed.", false);
+        fail("Required parameters validation failed.");
     }
 
     @Test