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/06/11 22:16:04 UTC

[camel] 04/16: [CAMEL-11807] Upgrade camel-cxf-transport 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 658acc2ebc0f2bc32d66f8db012822274f7dbc63
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Thu Jun 11 14:40:55 2020 +0200

    [CAMEL-11807] Upgrade camel-cxf-transport to junit5
---
 components/camel-cxf-transport/pom.xml             |  6 ++---
 .../cxf/common/header/CxfHeaderHelperTest.java     | 23 +++++++++--------
 .../cxf/common/message/CxfMessageHelperTest.java   | 29 ++++++++++++----------
 .../message/DefaultCxfMessageMapperTest.java       |  9 ++++---
 .../component/cxf/transport/CamelConduitTest.java  | 21 +++++++++-------
 .../cxf/transport/CamelDestinationTest.java        | 18 ++++++++------
 .../cxf/transport/CamelTransportTestSupport.java   | 18 ++++++++------
 .../cxf/transport/JaxWSCamelConduitTest.java       | 11 ++++----
 .../cxf/transport/JaxWSCamelDestinationTest.java   | 13 +++++-----
 .../cxf/transport/JaxWSCamelTestSupport.java       |  6 ++---
 10 files changed, 87 insertions(+), 67 deletions(-)

diff --git a/components/camel-cxf-transport/pom.xml b/components/camel-cxf-transport/pom.xml
index fa3b1a8..6fb79a1 100644
--- a/components/camel-cxf-transport/pom.xml
+++ b/components/camel-cxf-transport/pom.xml
@@ -114,12 +114,12 @@
         </dependency>
         <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-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelperTest.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelperTest.java
index a127908..c9dd651 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelperTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/header/CxfHeaderHelperTest.java
@@ -22,8 +22,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 
-import junit.framework.TestCase;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.component.cxf.common.message.CxfConstants;
 import org.apache.camel.impl.DefaultCamelContext;
@@ -32,15 +30,20 @@ import org.apache.camel.support.DefaultHeaderFilterStrategy;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.message.Message;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+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;
 
-public class CxfHeaderHelperTest extends TestCase {
+public class CxfHeaderHelperTest {
 
     private DefaultCamelContext context;
 
-    @Override
+    @BeforeEach
     protected void setUp() throws Exception {
-        super.setUp();
         context = new DefaultCamelContext();
         context.start();
     }
@@ -167,14 +170,14 @@ public class CxfHeaderHelperTest extends TestCase {
 
     private void verifyHeader(Map<String, List<String>> headers, String name, List<String> value) {
         List<String> values = headers.get(name);
-        assertTrue("The entry must be available", values != null && values.size() == ((List<?>)value).size());
-        assertEquals("The value must match", value, values);
+        assertTrue(values != null && values.size() == ((List<?>)value).size(), "The entry must be available");
+        assertEquals(value, values, "The value must match");
     }
 
     private void verifyHeader(Map<String, List<String>> headers, String name, String value) {
         List<String> values = headers.get(name);
-        assertTrue("The entry must be available", values != null && values.size() == 1);
-        assertEquals("The value must match", value, values.get(0));
+        assertTrue(values != null && values.size() == 1, "The entry must be available");
+        assertEquals(value, values.get(0), "The value must match");
     }
 
 }
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/CxfMessageHelperTest.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/CxfMessageHelperTest.java
index 175de1b..c9f79c0 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/CxfMessageHelperTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/CxfMessageHelperTest.java
@@ -36,10 +36,13 @@ import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.staxutils.StaxUtils;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class CxfMessageHelperTest extends Assert {
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class CxfMessageHelperTest {
     private static final String REQUEST_STRING =
         "<testMethod xmlns=\"http://camel.apache.org/testService\"/>";
     private DefaultCamelContext context = new DefaultCamelContext();
@@ -56,8 +59,8 @@ public class CxfMessageHelperTest extends Assert {
                 headerFilterStrategy, exchange, false);
         // test message
         InputStream is = message.getContent(InputStream.class);
-        assertNotNull("The input stream should not be null", is);
-        assertEquals("Don't get the right message", toString(is), "hello world");
+        assertNotNull(is, "The input stream should not be null");
+        assertEquals(toString(is), "hello world", "Don't get the right message");
 
         // DOMSource
         URL request = this.getClass().getResource("RequestBody.xml");
@@ -68,15 +71,15 @@ public class CxfMessageHelperTest extends Assert {
         exchange.getIn().setBody(source);
         message = CxfMessageHelper.getCxfInMessage(headerFilterStrategy, exchange, false);
         is = message.getContent(InputStream.class);
-        assertNotNull("The input stream should not be null", is);
-        assertEquals("Don't get the right message", toString(is), REQUEST_STRING);
+        assertNotNull(is, "The input stream should not be null");
+        assertEquals(toString(is), REQUEST_STRING, "Don't get the right message");
 
         // File
         exchange.getIn().setBody(requestFile);
         message = CxfMessageHelper.getCxfInMessage(headerFilterStrategy, exchange, false);
         is = message.getContent(InputStream.class);
-        assertNotNull("The input stream should not be null", is);
-        assertEquals("Don't get the right message", toString(is), REQUEST_STRING);
+        assertNotNull(is, "The input stream should not be null");
+        assertEquals(toString(is), REQUEST_STRING, "Don't get the right message");
 
         // transport header's case insensitiveness
         // String
@@ -87,8 +90,8 @@ public class CxfMessageHelperTest extends Assert {
         Map<String, List<String>> headers = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
         
         // verify there is no duplicate
-        assertNotNull("The headers must be present", headers);
-        assertTrue("There must be one header entry", headers.size() == 1);
+        assertNotNull(headers, "The headers must be present");
+        assertTrue(headers.size() == 1, "There must be one header entry");
         
         // verify the soapaction can be retrieved in case-insensitive ways
         verifyHeader(headers, "soapaction", "urn:hello:world");
@@ -98,8 +101,8 @@ public class CxfMessageHelperTest extends Assert {
 
     private void verifyHeader(Map<String, List<String>> headers, String name, String value) {
         List<String> values = headers.get(name);
-        assertTrue("The entry must be available", values != null && values.size() == 1);
-        assertEquals("The value must match", values.get(0), value);
+        assertTrue(values != null && values.size() == 1, "The entry must be available");
+        assertEquals(values.get(0), value, "The value must match");
     }
 
     private String toString(InputStream is) throws IOException {
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
index e17e2ff..1c51ac6 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/common/message/DefaultCxfMessageMapperTest.java
@@ -29,13 +29,16 @@ import org.apache.cxf.common.security.SimplePrincipal;
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.security.SecurityContext;
-import org.junit.Assert;
-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.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-public class DefaultCxfMessageMapperTest extends Assert {
+public class DefaultCxfMessageMapperTest {
 
     @Test
     public void testRequestUriAndPath() {
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java
index a1690cc..dc07323 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelConduitTest.java
@@ -33,7 +33,10 @@ import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
-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.assertNotNull;
 
 public class CamelConduitTest extends CamelTransportTestSupport {
 
@@ -78,8 +81,8 @@ public class CamelConduitTest extends CamelTransportTestSupport {
         CamelConduit conduit = new CamelConduit(null, bus, endpointInfo);
         CamelContext context = conduit.getCamelContext();
 
-        assertNotNull("the camel context which get from camel conduit is not null", context);
-        assertEquals("get the wrong camel context", context.getName(), "conduit_context");
+        assertNotNull(context, "the camel context which get from camel conduit is not null");
+        assertEquals(context.getName(), "conduit_context", "get the wrong camel context");
         assertEquals("direct://EndpointA", context.getRoutes().get(0).getEndpoint().getEndpointUri());
         
         // test the configuration of camelContextId attribute 
@@ -88,8 +91,8 @@ public class CamelConduitTest extends CamelTransportTestSupport {
         conduit = new CamelConduit(null, bus, endpointInfo);
         context = conduit.getCamelContext();
 
-        assertNotNull("the camel context which get from camel conduit is not null", context);
-        assertEquals("get the wrong camel context", context.getName(), "conduit_context");
+        assertNotNull(context, "the camel context which get from camel conduit is not null");
+        assertEquals(context.getName(), "conduit_context", "get the wrong camel context");
         assertEquals("direct://EndpointA", context.getRoutes().get(0).getEndpoint().getEndpointUri());
 
 
@@ -97,8 +100,8 @@ public class CamelConduitTest extends CamelTransportTestSupport {
         endpointInfo.setName(testEndpointQNameB);
         conduit = new CamelConduit(null, bus, endpointInfo);
         context = conduit.getCamelContext();
-        assertNotNull("the camel context which get from camel conduit is not null", context);
-        assertEquals("get the wrong camel context", context.getName(), "context");
+        assertNotNull(context, "the camel context which get from camel conduit is not null");
+        assertEquals(context.getName(), "context", "get the wrong camel context");
         assertEquals("direct://EndpointC", context.getRoutes().get(0).getEndpoint().getEndpointUri());
         bus.shutdown(false);
     }
@@ -118,7 +121,7 @@ public class CamelConduitTest extends CamelTransportTestSupport {
 
     public void verifyMessageContent(Message message) {
         OutputStream os = message.getContent(OutputStream.class);
-        assertTrue("OutputStream should not be null", os != null);
+        assertNotNull(os, "OutputStream should not be null");
     }
 
     @Test
@@ -157,7 +160,7 @@ public class CamelConduitTest extends CamelTransportTestSupport {
             ex.printStackTrace();
         }
         String reponse = new String(bytes);
-        assertEquals("The reponse date should be equals", content, reponse);
+        assertEquals(content, reponse, "The reponse date should be equals");
 
     }
 }
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java
index ff14974..91010d7 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelDestinationTest.java
@@ -47,8 +47,12 @@ import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.MessageObserver;
-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.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.isA;
 import static org.mockito.Mockito.mock;
@@ -87,9 +91,9 @@ public class CamelDestinationTest extends CamelTransportTestSupport {
         assertEquals("{http://camel.apache.org/camel-test}port.camel-destination", destination.getBeanName());
         CamelContext context = destination.getCamelContext();
 
-        assertNotNull("The camel context which get from camel destination is not null", context);
-        assertEquals("Get the wrong camel context", context.getName(), "dest_context");
-        assertEquals("The camel context should has two routers", context.getRoutes().size(), 2);
+        assertNotNull(context, "The camel context which get from camel destination is not null");
+        assertEquals(context.getName(), "dest_context", "Get the wrong camel context");
+        assertEquals(context.getRoutes().size(), 2, "The camel context should has two routers");
         bus.shutdown(false);
     }
 
@@ -132,13 +136,13 @@ public class CamelDestinationTest extends CamelTransportTestSupport {
             destination = setupCamelDestination(endpointInfo, true);
             // destination.activate();
         } catch (IOException e) {
-            assertFalse("The CamelDestination activate should not through exception ", false);
+            fail("The CamelDestination activate should not through exception ");
             e.printStackTrace();
         }
         sendoutMessage(conduit, outMessage, true, "HelloWorld");
 
         // just verify the Destination inMessage
-        assertTrue("The destiantion should have got the message ", destMessage != null);
+        assertNotNull(destMessage, "The destiantion should have got the message");
         verifyReceivedMessage(destMessage, "HelloWorld");
         destination.shutdown();
     }
@@ -150,7 +154,7 @@ public class CamelDestinationTest extends CamelTransportTestSupport {
         byte bytes[] = new byte[bis.available()];
         bis.read(bytes);
         String reponse = new String(bytes);
-        assertEquals("The reponse date should be equals", content, reponse);
+        assertEquals(content, reponse, "The reponse date should be equals");
     }
     
     @Test
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
index 6429d90..d2d6654 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/CamelTransportTestSupport.java
@@ -19,7 +19,7 @@ package org.apache.camel.component.cxf.transport;
 import java.io.IOException;
 import java.io.OutputStream;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.message.Exchange;
@@ -31,10 +31,13 @@ import org.apache.cxf.transport.ConduitInitiatorManager;
 import org.apache.cxf.transport.DestinationFactoryManager;
 import org.apache.cxf.transport.MessageObserver;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.junit.After;
-import org.junit.Before;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
 import org.mockito.Mockito;
 
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
+
 public abstract class CamelTransportTestSupport extends CamelTestSupport {
 
     protected Bus bus;
@@ -44,7 +47,7 @@ public abstract class CamelTransportTestSupport extends CamelTestSupport {
     protected Message inMessage;
 
     @Override
-    @Before
+    @BeforeEach
     public void setUp() throws Exception {
         super.setUp();
         BusFactory bf = BusFactory.newInstance();
@@ -62,7 +65,7 @@ public abstract class CamelTransportTestSupport extends CamelTestSupport {
     }
 
     @Override
-    @After
+    @AfterEach
     public void tearDown() throws Exception {
         bus.shutdown(true);
         super.tearDown();
@@ -101,11 +104,10 @@ public abstract class CamelTransportTestSupport extends CamelTestSupport {
         try {
             conduit.prepare(message);
         } catch (IOException ex) {
-            assertFalse("CamelConduit can't perpare to send out message", false);
-            ex.printStackTrace();
+            fail("CamelConduit can't prepare to send out message");
         }
         OutputStream os = message.getContent(OutputStream.class);
-        assertTrue("The OutputStream should not be null ", os != null);
+        assertNotNull(os, "The OutputStream should not be null");
         os.write(content.getBytes());
         os.close();
     }
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelConduitTest.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelConduitTest.java
index c7e01de..4b9c6e8 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelConduitTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelConduitTest.java
@@ -22,9 +22,10 @@ import java.util.concurrent.Future;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.hamcrest.CoreMatchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 
 /**
  * Test CXF-CamelConduit when the destination is not a pipeline
@@ -56,7 +57,7 @@ public class JaxWSCamelConduitTest extends JaxWSCamelTestSupport {
    
     @Test
     public void testStart1() {
-        assertThat(getSampleWS("direct:start1").getSomething(), is("Something"));
+        assertEquals("Something", getSampleWS("direct:start1").getSomething());
         
     }
 
@@ -65,13 +66,13 @@ public class JaxWSCamelConduitTest extends JaxWSCamelTestSupport {
      */
     @Test
     public void testStart2() {
-        assertThat(getSampleWSWithCXFAPI("direct:start2").getSomething(), is("Something"));
+        assertEquals("Something", getSampleWSWithCXFAPI("direct:start2").getSomething());
     }
     
     // test the content type
     @Test
     public void testStart3() {
-        assertThat(getSampleWS("direct:start3").getSomething(), is("Something"));
+        assertEquals("Something", getSampleWS("direct:start3").getSomething());
     }
     
     @Test
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelDestinationTest.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelDestinationTest.java
index a2fc518..dec4b1f 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelDestinationTest.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelDestinationTest.java
@@ -21,16 +21,17 @@ import javax.xml.ws.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import org.junit.After;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
 
-import static org.hamcrest.CoreMatchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 // Test the CamelDestination with whole CXF context
 public class JaxWSCamelDestinationTest extends JaxWSCamelTestSupport {
     private Endpoint endpoint;
     
-    @After
+    @AfterEach
     public void stopEndpoint() {
         if (endpoint != null) {
             endpoint.stop();
@@ -60,7 +61,7 @@ public class JaxWSCamelDestinationTest extends JaxWSCamelTestSupport {
             }
             
         });
-        assertThat(exchange.getOut().getHeader(Exchange.CONTENT_TYPE, String.class), is("text/xml; charset=UTF-8"));
+        assertEquals("text/xml; charset=UTF-8", exchange.getOut().getHeader(Exchange.CONTENT_TYPE, String.class));
         assertTrue(exchange.getOut().getBody(String.class).indexOf("something!") > 0);
     }
 
@@ -77,6 +78,6 @@ public class JaxWSCamelDestinationTest extends JaxWSCamelTestSupport {
             }
             
         });
-        assertThat(exchange.getOut().getHeader(Exchange.CONTENT_ENCODING, String.class), is("gzip"));
+        assertEquals("gzip", exchange.getOut().getHeader(Exchange.CONTENT_ENCODING, String.class));
     }
 }
diff --git a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelTestSupport.java b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelTestSupport.java
index 7512ea1..5c06be3 100644
--- a/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelTestSupport.java
+++ b/components/camel-cxf-transport/src/test/java/org/apache/camel/component/cxf/transport/JaxWSCamelTestSupport.java
@@ -28,12 +28,12 @@ import javax.xml.ws.Endpoint;
 import javax.xml.ws.Response;
 import javax.xml.ws.Service;
 
-import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.test.junit5.CamelTestSupport;
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
-import org.junit.Before;
+import org.junit.jupiter.api.BeforeEach;
 
 public class JaxWSCamelTestSupport extends CamelTestSupport {
     
@@ -89,7 +89,7 @@ public class JaxWSCamelTestSupport extends CamelTestSupport {
     /**
      * Initialize CamelTransportFactory without Spring
      */
-    @Before
+    @BeforeEach
     public void setUpCXFCamelContext() {
         bus = BusFactory.getThreadDefaultBus();
         // make sure the CamelTransportFactory is injected with right camel context