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/15 17:11:42 UTC

[camel] 13/14: [CAMEL-11807] Upgrade camel-microprofile-health 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 34aedf24d7ed983e0142c82a005d94feccf1e875
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Wed Jul 15 17:15:17 2020 +0200

    [CAMEL-11807] Upgrade camel-microprofile-health to junit5
---
 components/camel-microprofile-health/pom.xml                     | 6 +++---
 .../health/CamelMicroProfileHealthCheckRepositoryTest.java       | 4 +++-
 .../microprofile/health/CamelMicroProfileHealthCheckTest.java    | 5 ++++-
 .../microprofile/health/CamelMicroProfileHealthTestSupport.java  | 9 +++++++--
 4 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/components/camel-microprofile-health/pom.xml b/components/camel-microprofile-health/pom.xml
index 1d4f27b..1401c69 100644
--- a/components/camel-microprofile-health/pom.xml
+++ b/components/camel-microprofile-health/pom.xml
@@ -61,7 +61,7 @@
         <!-- testing -->
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test</artifactId>
+            <artifactId>camel-test-junit5</artifactId>
             <scope>test</scope>
         </dependency>
 
@@ -93,8 +93,8 @@
         </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-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java b/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java
index 8883998..f4e08a1 100644
--- a/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java
+++ b/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckRepositoryTest.java
@@ -24,7 +24,9 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.eclipse.microprofile.health.HealthCheckResponse.State;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 public class CamelMicroProfileHealthCheckRepositoryTest extends CamelMicroProfileHealthTestSupport {
 
diff --git a/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java b/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java
index dac0691..9d27f12 100644
--- a/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java
+++ b/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthCheckTest.java
@@ -24,7 +24,10 @@ import org.apache.camel.ServiceStatus;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.impl.engine.ExplicitCamelContextNameStrategy;
 import org.eclipse.microprofile.health.HealthCheckResponse.State;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
 
 public class CamelMicroProfileHealthCheckTest extends CamelMicroProfileHealthTestSupport {
 
diff --git a/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java b/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
index 7ce3e39..8fda636 100644
--- a/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
+++ b/components/camel-microprofile-health/src/test/java/org/apache/camel/microprofile/health/CamelMicroProfileHealthTestSupport.java
@@ -30,14 +30,19 @@ import io.smallrye.health.SmallRyeHealth;
 import io.smallrye.health.SmallRyeHealthReporter;
 import org.apache.camel.health.HealthCheck;
 import org.apache.camel.health.HealthCheckResultBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.eclipse.microprofile.health.HealthCheckResponse;
+import org.junit.jupiter.api.BeforeEach;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class CamelMicroProfileHealthTestSupport extends CamelTestSupport {
 
     protected SmallRyeHealthReporter reporter;
 
     @Override
+    @BeforeEach
     public void setUp() throws Exception {
         super.setUp();
         reporter = new SmallRyeHealthReporter();
@@ -51,7 +56,7 @@ public class CamelMicroProfileHealthTestSupport extends CamelTestSupport {
 
     protected JsonObject getHealthJson(SmallRyeHealth health) {
         JsonParser parser = Json.createParser(new StringReader(getHealthOutput(health)));
-        assertTrue("Health check content is empty", parser.hasNext());
+        assertTrue(parser.hasNext(), "Health check content is empty");
         parser.next();
         return parser.getObject();
     }