[camel] branch CAMEL-13826 updated: CAMEL-13826: Migrated camel-jmx tests to camel-test-junit5

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[camel] branch CAMEL-13826 updated: CAMEL-13826: Migrated camel-jmx tests to camel-test-junit5

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

aldettinger pushed a commit to branch CAMEL-13826
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/CAMEL-13826 by this push:
     new db5a869  CAMEL-13826: Migrated camel-jmx tests to camel-test-junit5
db5a869 is described below

commit db5a8696531de97ae917856b9b32263995e50a47
Author: aldettinger <[hidden email]>
AuthorDate: Wed Aug 14 16:06:20 2019 +0200

    CAMEL-13826: Migrated camel-jmx tests to camel-test-junit5
---
 components/camel-jmx/pom.xml                        |  7 +------
 ...nsumerObserveAttributeMatchStringDifferTest.java |  4 ++--
 ...lJmxConsumerObserveAttributeMatchStringTest.java |  4 ++--
 .../jmx/CamelJmxConsumerObserveAttributeTest.java   |  4 ++--
 .../camel/component/jmx/CamelJmxConsumerTest.java   |  4 ++--
 .../camel/component/jmx/JMXComponentTest.java       | 12 ++++++------
 .../apache/camel/component/jmx/JMXConsumerTest.java | 10 +++++-----
 .../apache/camel/component/jmx/JMXEndpointTest.java | 18 +++++++++---------
 .../apache/camel/component/jmx/JMXHandbackTest.java |  9 ++++-----
 .../component/jmx/JMXMonitorTypeCounterTest.java    |  2 +-
 .../component/jmx/JMXMonitorTypeGaugeTest.java      |  2 +-
 .../jmx/JMXMonitorTypeLongCounterTest.java          |  2 +-
 .../jmx/JMXMonitorTypeStringDiffersTest.java        |  2 +-
 .../jmx/JMXMonitorTypeStringMatchesTest.java        |  2 +-
 .../component/jmx/JMXNotificationFilterTest.java    |  8 ++++----
 .../component/jmx/JMXObjectPropertiesTest.java      |  2 +-
 .../apache/camel/component/jmx/JMXRemoteTest.java   |  6 +++---
 .../jmx/JMXRobustRemoteConnectionTest.java          | 21 ++++++++++-----------
 .../camel/component/jmx/JMXUriBuilderTest.java      |  4 ++--
 .../camel/component/jmx/MockEndpointFixture.java    |  6 +++---
 .../camel/component/jmx/SimpleBeanFixture.java      |  8 ++++----
 .../org/apache/camel/component/jmx/XmlFixture.java  |  4 ++--
 22 files changed, 67 insertions(+), 74 deletions(-)

diff --git a/components/camel-jmx/pom.xml b/components/camel-jmx/pom.xml
index 013d1ae..11d1130 100644
--- a/components/camel-jmx/pom.xml
+++ b/components/camel-jmx/pom.xml
@@ -44,12 +44,7 @@
         <!-- test dependencies -->
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
+            <artifactId>camel-test-junit5</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringDifferTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringDifferTest.java
index fc81b2a..9baa615 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringDifferTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringDifferTest.java
@@ -20,8 +20,8 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.api.management.ManagedCamelContext;
 import org.apache.camel.api.management.mbean.ManagedRouteMBean;
 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;
 
 public class CamelJmxConsumerObserveAttributeMatchStringDifferTest extends CamelTestSupport {
 
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringTest.java
index d1e8f8e..562ef84 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeMatchStringTest.java
@@ -20,8 +20,8 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.api.management.ManagedCamelContext;
 import org.apache.camel.api.management.mbean.ManagedRouteMBean;
 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;
 
 public class CamelJmxConsumerObserveAttributeMatchStringTest extends CamelTestSupport {
 
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeTest.java
index 9d2749e..ccabaa1 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerObserveAttributeTest.java
@@ -20,8 +20,8 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.api.management.ManagedCamelContext;
 import org.apache.camel.api.management.mbean.ManagedRouteMBean;
 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;
 
 public class CamelJmxConsumerObserveAttributeTest extends CamelTestSupport {
 
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerTest.java
index f106df8..a399d21 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/CamelJmxConsumerTest.java
@@ -20,8 +20,8 @@ import org.apache.camel.RoutesBuilder;
 import org.apache.camel.api.management.ManagedCamelContext;
 import org.apache.camel.api.management.mbean.ManagedRouteMBean;
 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;
 
 public class CamelJmxConsumerTest extends CamelTestSupport {
 
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXComponentTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXComponentTest.java
index 05c6f7e..cb7b291 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXComponentTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXComponentTest.java
@@ -20,13 +20,13 @@ import java.util.Map;
 
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.impl.DefaultCamelContext;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Test behavior in the component for initializing an endpoint. Not much here beyond
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXConsumerTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXConsumerTest.java
index 6fd9ffe..f10b0fb 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXConsumerTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXConsumerTest.java
@@ -19,9 +19,9 @@ package org.apache.camel.component.jmx;
 import java.io.File;
 
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests that trigger notification events on our simple bean without
@@ -32,7 +32,7 @@ public class JMXConsumerTest extends SimpleBeanFixture {
     ISimpleMXBean simpleBean;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         super.setUp();
         simpleBean = getSimpleMXBean();
@@ -78,7 +78,7 @@ public class JMXConsumerTest extends SimpleBeanFixture {
         waitAndAssertMessageReceived("src/test/resources/consumer-test/mbeanServerNotification.xml");
     }
 
-    @Ignore
+    @Disabled
     public void relationNotification() throws Exception {
         simpleBean.triggerRelationNotification();
         waitAndAssertMessageReceived("src/test/resources/consumer-test/relationNotification.xml");
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXEndpointTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXEndpointTest.java
index 8e108b7..b358838 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXEndpointTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXEndpointTest.java
@@ -21,15 +21,15 @@ import java.util.Hashtable;
 import javax.management.ObjectName;
 
 import org.apache.camel.impl.DefaultCamelContext;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Tests for the endpoint. Most of the params in the endpoint are
@@ -40,7 +40,7 @@ public class JMXEndpointTest {
 
     DefaultCamelContext context;
     
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         context = new DefaultCamelContext();
     }
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXHandbackTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXHandbackTest.java
index 455fb64..0166f9e 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXHandbackTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXHandbackTest.java
@@ -20,11 +20,10 @@ import java.net.URI;
 
 import org.apache.camel.Message;
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertSame;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertSame;
 
 /**
  * Tests that we get the handback object in the message header
@@ -34,7 +33,7 @@ public class JMXHandbackTest extends SimpleBeanFixture {
     URI hb;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         hb = new URI("urn:some:handback:object");
         super.setUp();
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeCounterTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeCounterTest.java
index a8c43e8..0452049 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeCounterTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeCounterTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.jmx;
 import java.io.File;
 
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class JMXMonitorTypeCounterTest extends SimpleBeanFixture {
     
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeGaugeTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeGaugeTest.java
index ccba9d5..916c7ec 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeGaugeTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeGaugeTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.jmx;
 import java.io.File;
 
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class JMXMonitorTypeGaugeTest extends SimpleBeanFixture {
     
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeLongCounterTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeLongCounterTest.java
index e59ef47..b8b2d7f 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeLongCounterTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeLongCounterTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.jmx;
 import java.io.File;
 
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 
 public class JMXMonitorTypeLongCounterTest extends SimpleBeanFixture {
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringDiffersTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringDiffersTest.java
index 0a30f35..b56ac46 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringDiffersTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringDiffersTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.jmx;
 import java.io.File;
 
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class JMXMonitorTypeStringDiffersTest extends SimpleBeanFixture {
     
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringMatchesTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringMatchesTest.java
index 5338486..721b2b4 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringMatchesTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXMonitorTypeStringMatchesTest.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.jmx;
 import java.io.File;
 
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class JMXMonitorTypeStringMatchesTest extends SimpleBeanFixture {
     
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXNotificationFilterTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXNotificationFilterTest.java
index aa1c8ac..5d90034 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXNotificationFilterTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXNotificationFilterTest.java
@@ -22,9 +22,9 @@ import javax.management.NotificationFilter;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Tests that the NotificationFilter is applied if configured
@@ -40,7 +40,7 @@ public class JMXNotificationFilterTest extends SimpleBeanFixture {
     public void testNotificationFilter() throws Exception {
         ISimpleMXBean bean = getSimpleMXBean();
 
-        assertEquals("no notifications should have been filtered at this point", 0, mRejected.size());
+        assertEquals(0, mRejected.size(), "no notifications should have been filtered at this point");
 
         // we should only get 5 messages, which is 1/2 the number of times we touched the object.
         // The 1/2 is due to the behavior of the test NotificationFilter implemented below
@@ -50,7 +50,7 @@ public class JMXNotificationFilterTest extends SimpleBeanFixture {
         }
 
         getMockFixture().waitForMessages();
-        assertEquals("5 notifications should have been filtered", 5, mRejected.size());
+        assertEquals(5, mRejected.size(), "5 notifications should have been filtered");
 
         // assert that all of the rejected ones are odd and accepted ones even
         for (Notification rejected : mRejected) {
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXObjectPropertiesTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXObjectPropertiesTest.java
index 0c767c2..7fbc1e5 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXObjectPropertiesTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXObjectPropertiesTest.java
@@ -20,7 +20,7 @@ import java.util.Hashtable;
 import java.util.Map;
 
 import org.apache.camel.component.jmx.beans.ISimpleMXBean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests that the objectName is created with the hashtable of objectProperties
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRemoteTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRemoteTest.java
index cf85d04..e9ed169 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRemoteTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRemoteTest.java
@@ -27,8 +27,8 @@ import javax.management.remote.JMXConnectorServerFactory;
 import javax.management.remote.JMXServiceURL;
 
 import org.apache.camel.test.AvailablePortFinder;
-import org.junit.After;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
 
 /**
  * Tests against a "remote" JMX server. Creates an RMI Registry on or near port 39000
@@ -45,7 +45,7 @@ public class JMXRemoteTest extends SimpleBeanFixture {
     Registry registry;
 
     @Override
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         super.tearDown();
         connector.stop();
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRobustRemoteConnectionTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRobustRemoteConnectionTest.java
index 1c36237..31b7d5c 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRobustRemoteConnectionTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXRobustRemoteConnectionTest.java
@@ -28,13 +28,12 @@ import javax.management.remote.JMXConnectorServerFactory;
 import javax.management.remote.JMXServiceURL;
 
 import org.apache.camel.test.AvailablePortFinder;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
 
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 
 /**
  * Test to verify:
@@ -52,7 +51,7 @@ public class JMXRobustRemoteConnectionTest extends SimpleBeanFixture {
     Registry registry;
     int port;
     
-    @Before
+    @BeforeEach
     @Override
     public void setUp() throws Exception {
         port = AvailablePortFinder.getNextAvailable(39000);
@@ -63,7 +62,7 @@ public class JMXRobustRemoteConnectionTest extends SimpleBeanFixture {
     }
     
     @Override
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         super.tearDown();
         connector.stop();
@@ -106,7 +105,7 @@ public class JMXRobustRemoteConnectionTest extends SimpleBeanFixture {
         getSimpleMXBean().touch();
         getMockFixture().waitForMessages();
         getMockFixture().assertMessageReceived(new File("src/test/resources/consumer-test/touched.xml"));
-                
+
         // stop the server; the JMX consumer should lose connectivity and the mock will not receive notifications
         connector.stop();
         Thread.sleep(2000);
@@ -114,11 +113,11 @@ public class JMXRobustRemoteConnectionTest extends SimpleBeanFixture {
         getMockFixture().getMockEndpoint().setExpectedMessageCount(1);
         getSimpleMXBean().touch();
         getMockFixture().getMockEndpoint().assertIsNotSatisfied();
-        
+
         // restart the server;  the JMX consumer should re-connect and the mock should receive a notification
         initServer();
         initBean();
-        Thread.sleep(2000);        
+        Thread.sleep(2000);
         getSimpleMXBean().touch();
         getMockFixture().waitForMessages();
         getMockFixture().assertMessageReceived(new File("src/test/resources/consumer-test/touched.xml"));
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXUriBuilderTest.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXUriBuilderTest.java
index 7a059be..494635a 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXUriBuilderTest.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/JMXUriBuilderTest.java
@@ -18,9 +18,9 @@ package org.apache.camel.component.jmx;
 
 import java.util.LinkedHashMap;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
 /**
  * Various tests for the uri builder
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/MockEndpointFixture.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/MockEndpointFixture.java
index ee52094..91db651 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/MockEndpointFixture.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/MockEndpointFixture.java
@@ -28,8 +28,8 @@ import org.apache.camel.Message;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.xmlunit.xpath.JAXPXPathEngine;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 /**
  * Waits for messages to arrive on the mock endpoint and performs assertions on the message bodies.
@@ -47,7 +47,7 @@ public class MockEndpointFixture {
 
     protected void waitForMessages(MockEndpoint aMockEndpoint) throws InterruptedException {
         mMockEndpoint.await(10, TimeUnit.SECONDS);
-        assertEquals("Expected number of messages didn't arrive before timeout", aMockEndpoint.getExpectedCount(), aMockEndpoint.getReceivedCounter());
+        assertEquals(aMockEndpoint.getExpectedCount(), aMockEndpoint.getReceivedCounter(), "Expected number of messages didn't arrive before timeout");
     }
     
     protected MockEndpoint getMockEndpoint() {
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/SimpleBeanFixture.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/SimpleBeanFixture.java
index 73bb93f..c8809e1 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/SimpleBeanFixture.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/SimpleBeanFixture.java
@@ -34,8 +34,8 @@ import org.apache.camel.component.jmx.beans.SimpleBean;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.support.SimpleRegistry;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 
 /**
  * MBean that is registered for the unit tests. The fixture will register a bean
@@ -69,7 +69,7 @@ public class SimpleBeanFixture {
     private MockEndpointFixture mMockEndpoint;
 
 
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         initServer();
         initBean();
@@ -82,7 +82,7 @@ public class SimpleBeanFixture {
         mContext.start();
     }
 
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         if (!mContext.isStopped()) {
             mContext.stop();
diff --git a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/XmlFixture.java b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/XmlFixture.java
index 87b5c92..c64fc4f 100644
--- a/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/XmlFixture.java
+++ b/components/camel-jmx/src/test/java/org/apache/camel/component/jmx/XmlFixture.java
@@ -30,7 +30,7 @@ import org.xmlunit.builder.DiffBuilder;
 import org.xmlunit.builder.Input;
 import org.xmlunit.diff.Diff;
 
-import static org.junit.Assert.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 
 public final class XmlFixture {
 
@@ -50,7 +50,7 @@ public final class XmlFixture {
                 .ignoreComments().ignoreWhitespace()
                 .checkForSimilar().build();
         try {
-            assertFalse(aMessage + ":\n" + diff.toString(), diff.hasDifferences());
+            assertFalse(diff.hasDifferences(), aMessage + ":\n" + diff.toString());
         } catch (Throwable t) {
             dump(aActual);
             throw t;