You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by al...@apache.org on 2019/11/18 10:26:00 UTC

[camel] 02/03: CAMEL-11807: Migrated camel-swagger-java tests to JUnit 5

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

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

commit 96c6edcbb6f923ddf2d57bd853626044d0ba5f49
Author: aldettinger <al...@gmail.com>
AuthorDate: Wed Nov 13 17:03:03 2019 +0100

    CAMEL-11807: Migrated camel-swagger-java tests to JUnit 5
---
 components/camel-swagger-java/pom.xml                  |  8 +-------
 .../apache/camel/swagger/RestSwaggerArrayEnumTest.java |  2 +-
 .../swagger/RestSwaggerReaderApiDocsOverrideTest.java  | 14 +++++++++++---
 .../camel/swagger/RestSwaggerReaderApiDocsTest.java    | 15 ++++++++++++---
 .../camel/swagger/RestSwaggerReaderDayOfWeekTest.java  | 13 ++++++++++---
 .../RestSwaggerReaderEnableVendorExtensionTest.java    | 14 +++++++++++---
 .../swagger/RestSwaggerReaderModelApiSecurityTest.java | 14 +++++++++++---
 .../swagger/RestSwaggerReaderModelBookOrderTest.java   | 13 ++++++++++---
 .../camel/swagger/RestSwaggerReaderModelTest.java      | 14 +++++++++++---
 .../RestSwaggerReaderOverrideHostApiDocsTest.java      | 12 ++++++++++--
 .../RestSwaggerReaderPropertyPlaceholderTest.java      | 18 +++++++++++++-----
 .../apache/camel/swagger/RestSwaggerReaderTest.java    | 13 ++++++++++---
 .../apache/camel/swagger/RestSwaggerSupportTest.java   |  3 +--
 .../SpringRestSwaggerReaderModelApiSecurityTest.java   | 14 +++++++++++---
 .../camel/swagger/SwaggerRestProducerFactoryTest.java  |  2 +-
 .../camel/swagger/producer/RestSwaggerGetTest.java     |  4 ++--
 .../swagger/producer/RestSwaggerGetUriParamTest.java   |  4 ++--
 17 files changed, 128 insertions(+), 49 deletions(-)

diff --git a/components/camel-swagger-java/pom.xml b/components/camel-swagger-java/pom.xml
index 931f556..332be6c 100644
--- a/components/camel-swagger-java/pom.xml
+++ b/components/camel-swagger-java/pom.xml
@@ -131,7 +131,7 @@
         <!-- testing -->
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test-spring</artifactId>
+            <artifactId>camel-test-spring-junit5</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
@@ -153,12 +153,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.junit.vintage</groupId>
-            <artifactId>junit-vintage-engine</artifactId>
-            <version>${junit-jupiter-version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.logging.log4j</groupId>
             <artifactId>log4j-api</artifactId>
             <scope>test</scope>
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerArrayEnumTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerArrayEnumTest.java
index bfba159..2cf5da9 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerArrayEnumTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerArrayEnumTest.java
@@ -28,7 +28,7 @@ import io.swagger.models.parameters.Parameter;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestDefinition;
 import org.apache.camel.model.rest.RestParamType;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsOverrideTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsOverrideTest.java
index aac699f..8e30b5f 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsOverrideTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsOverrideTest.java
@@ -25,11 +25,19 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderApiDocsOverrideTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderApiDocsOverrideTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -63,7 +71,7 @@ public class RestSwaggerReaderApiDocsOverrideTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertFalse(json.contains("\"/hello/bye\""));
         assertFalse(json.contains("\"summary\" : \"To update the greeting message\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsTest.java
index 322d00c..b037dd6 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderApiDocsTest.java
@@ -25,11 +25,19 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderApiDocsTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderApiDocsTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -49,6 +57,7 @@ public class RestSwaggerReaderApiDocsTest extends CamelTestSupport {
 
     @Test
     public void testReaderRead() throws Exception {
+
         BeanConfig config = new BeanConfig();
         config.setHost("localhost:8080");
         config.setSchemes(new String[] {"http"});
@@ -63,7 +72,7 @@ public class RestSwaggerReaderApiDocsTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
         assertTrue(json.contains("\"basePath\" : \"/api\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderDayOfWeekTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderDayOfWeekTest.java
index 6f013a6..fffc3b3 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderDayOfWeekTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderDayOfWeekTest.java
@@ -25,11 +25,18 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderDayOfWeekTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderDayOfWeekTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -68,7 +75,7 @@ public class RestSwaggerReaderDayOfWeekTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
         assertTrue(json.contains("\"default\" : \"friday\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderEnableVendorExtensionTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderEnableVendorExtensionTest.java
index d4fc26c..da42e83 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderEnableVendorExtensionTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderEnableVendorExtensionTest.java
@@ -25,11 +25,19 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderEnableVendorExtensionTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderEnableVendorExtensionTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -75,7 +83,7 @@ public class RestSwaggerReaderEnableVendorExtensionTest extends CamelTestSupport
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         String camelId = context.getName();
         String routeId = context.getRouteDefinitions().get(0).getId();
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelApiSecurityTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelApiSecurityTest.java
index 2dab809..61a3237 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelApiSecurityTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelApiSecurityTest.java
@@ -25,11 +25,19 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderModelApiSecurityTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderModelApiSecurityTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -78,7 +86,7 @@ public class RestSwaggerReaderModelApiSecurityTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"securityDefinitions\" : {"));
         assertTrue(json.contains("\"type\" : \"oauth2\","));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelBookOrderTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelBookOrderTest.java
index 7efc197..efe4467 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelBookOrderTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelBookOrderTest.java
@@ -25,11 +25,18 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderModelBookOrderTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderModelBookOrderTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -67,7 +74,7 @@ public class RestSwaggerReaderModelBookOrderTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
         assertTrue(json.contains("\"description\" : \"The order returned\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelTest.java
index 33b1a92..32e52e6 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderModelTest.java
@@ -25,11 +25,19 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderModelTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderModelTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -73,7 +81,7 @@ public class RestSwaggerReaderModelTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
         assertTrue(json.contains("\"description\" : \"The user returned\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderOverrideHostApiDocsTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderOverrideHostApiDocsTest.java
index 9475517..bc885d7 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderOverrideHostApiDocsTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderOverrideHostApiDocsTest.java
@@ -22,10 +22,18 @@ import com.fasterxml.jackson.databind.SerializationFeature;
 import io.swagger.jaxrs.config.BeanConfig;
 import io.swagger.models.Swagger;
 import org.apache.camel.impl.engine.DefaultClassResolver;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderOverrideHostApiDocsTest extends RestSwaggerReaderApiDocsTest {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderOverrideHostApiDocsTest.class);
+
     @Override
     @Test
     public void testReaderRead() throws Exception {
@@ -44,7 +52,7 @@ public class RestSwaggerReaderOverrideHostApiDocsTest extends RestSwaggerReaderA
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"host\" : \"http:mycoolserver:8888/myapi\""));
         assertTrue(json.contains("\"basePath\" : \"/api\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderPropertyPlaceholderTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderPropertyPlaceholderTest.java
index 8c6d218..387a155 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderPropertyPlaceholderTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderPropertyPlaceholderTest.java
@@ -30,13 +30,21 @@ import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestDefinition;
 import org.apache.camel.model.rest.RestParamType;
 import org.apache.camel.swagger.producer.DummyRestProducerFactory;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-@Ignore("Does not run well on CI due test uses JMX mbeans")
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@Disabled("Does not run well on CI due test uses JMX mbeans")
 public class RestSwaggerReaderPropertyPlaceholderTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderPropertyPlaceholderTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestProducerFactory factory = new DummyRestProducerFactory();
 
@@ -86,7 +94,7 @@ public class RestSwaggerReaderPropertyPlaceholderTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
         assertTrue(json.contains("\"basePath\" : \"/api\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderTest.java
index 0071d7d..363fd10 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerReaderTest.java
@@ -25,11 +25,18 @@ import org.apache.camel.BindToRegistry;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.engine.DefaultClassResolver;
 import org.apache.camel.model.rest.RestParamType;
-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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 
 public class RestSwaggerReaderTest extends CamelTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(RestSwaggerReaderTest.class);
+
     @BindToRegistry("dummy-rest")
     private DummyRestConsumerFactory factory = new DummyRestConsumerFactory();
 
@@ -64,7 +71,7 @@ public class RestSwaggerReaderTest extends CamelTestSupport {
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"host\" : \"localhost:8080\""));
         assertTrue(json.contains("\"basePath\" : \"/api\""));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerSupportTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerSupportTest.java
index d9042e5..59dbc13 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerSupportTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/RestSwaggerSupportTest.java
@@ -32,7 +32,6 @@ import static org.junit.jupiter.params.provider.Arguments.arguments;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
 
 public class RestSwaggerSupportTest {
 
@@ -90,7 +89,7 @@ public class RestSwaggerSupportTest {
 
         RestSwaggerSupport.setupXForwardedHeaders(swagger, Collections.emptyMap());
 
-        verifyZeroInteractions(swagger);
+        verifyNoMoreInteractions(swagger);
     }
 
     static Stream<Arguments> basePathAndPrefixVariations() {
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SpringRestSwaggerReaderModelApiSecurityTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SpringRestSwaggerReaderModelApiSecurityTest.java
index 27f9841..7134593 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SpringRestSwaggerReaderModelApiSecurityTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SpringRestSwaggerReaderModelApiSecurityTest.java
@@ -22,13 +22,21 @@ import com.fasterxml.jackson.databind.SerializationFeature;
 import io.swagger.jaxrs.config.BeanConfig;
 import io.swagger.models.Swagger;
 import org.apache.camel.impl.engine.DefaultClassResolver;
-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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 public class SpringRestSwaggerReaderModelApiSecurityTest extends CamelSpringTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(SpringRestSwaggerReaderModelApiSecurityTest.class);
+
     @Override
     protected AbstractApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/camel/swagger/SpringRestSwaggerReaderModelApiSecurityTest.xml");
@@ -53,7 +61,7 @@ public class SpringRestSwaggerReaderModelApiSecurityTest extends CamelSpringTest
         mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
         String json = mapper.writeValueAsString(swagger);
 
-        log.info(json);
+        LOG.info(json);
 
         assertTrue(json.contains("\"securityDefinitions\" : {"));
         assertTrue(json.contains("\"type\" : \"oauth2\","));
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SwaggerRestProducerFactoryTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SwaggerRestProducerFactoryTest.java
index a84889b..1d76488 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SwaggerRestProducerFactoryTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/SwaggerRestProducerFactoryTest.java
@@ -17,7 +17,7 @@
 package org.apache.camel.swagger;
 
 import org.apache.camel.impl.DefaultCamelContext;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
 public class SwaggerRestProducerFactoryTest {
 
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetTest.java
index f28f260..b0ab3bb 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetTest.java
@@ -19,8 +19,8 @@ package org.apache.camel.swagger.producer;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.RoutesBuilder;
 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 RestSwaggerGetTest extends CamelTestSupport {
 
diff --git a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetUriParamTest.java b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetUriParamTest.java
index 2f625ee..beed34c 100644
--- a/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetUriParamTest.java
+++ b/components/camel-swagger-java/src/test/java/org/apache/camel/swagger/producer/RestSwaggerGetUriParamTest.java
@@ -19,8 +19,8 @@ package org.apache.camel.swagger.producer;
 import org.apache.camel.BindToRegistry;
 import org.apache.camel.RoutesBuilder;
 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 RestSwaggerGetUriParamTest extends CamelTestSupport {