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 1807b2eaf52c1526ef2d54ad753c00b077b1d6ca
Author: Guillaume Nodet <gno...@gmail.com>
AuthorDate: Tue Jun 16 08:08:13 2020 +0200

    [CAMEL-11807] Upgrade camel-spring-main to junit5
---
 components/camel-spring-main/pom.xml                           |  6 +++---
 .../src/test/java/org/apache/camel/spring/MainDummyTest.java   | 10 ++++++----
 .../src/test/java/org/apache/camel/spring/MainExampleTest.java |  5 ++---
 .../src/test/java/org/apache/camel/spring/MainIoCTest.java     |  5 ++---
 .../src/test/java/org/apache/camel/spring/MainTest.java        |  5 ++---
 .../src/test/java/org/apache/camel/spring/MainVetoTest.java    |  7 ++++---
 .../java/org/apache/camel/spring/MisspelledRouteRefTest.java   |  9 +++++----
 .../apache/camel/spring/SpringMainStartFailedIssueTest.java    | 10 +++++++---
 8 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/components/camel-spring-main/pom.xml 
b/components/camel-spring-main/pom.xml
index b7d5402..22b234e 100644
--- a/components/camel-spring-main/pom.xml
+++ b/components/camel-spring-main/pom.xml
@@ -54,12 +54,12 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test-spring</artifactId>
+            <artifactId>camel-test-spring-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-spring-main/src/test/java/org/apache/camel/spring/MainDummyTest.java
 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainDummyTest.java
index 6561798..e871a00 100644
--- 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainDummyTest.java
+++ 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainDummyTest.java
@@ -17,10 +17,12 @@
 package org.apache.camel.spring;
 
 import org.apache.camel.CamelContext;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class MainDummyTest extends Assert {
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+public class MainDummyTest {
 
     @Test
     public void testMain() throws Exception {
@@ -29,7 +31,7 @@ public class MainDummyTest extends Assert {
 
         // should also be a Camel
         CamelContext camel = 
main.getApplicationContext().getBean(CamelContext.class);
-        assertNotNull("Camel should be in Spring", camel);
+        assertNotNull(camel, "Camel should be in Spring");
 
         DummyBean dummy = (DummyBean) 
main.getApplicationContext().getBean("dummy");
         assertNotNull(dummy);
diff --git 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainExampleTest.java
 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainExampleTest.java
index 644adf7..3f4a4b8 100644
--- 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainExampleTest.java
+++ 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainExampleTest.java
@@ -17,10 +17,9 @@
 package org.apache.camel.spring;
 
 import org.apache.camel.builder.RouteBuilder;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class MainExampleTest extends Assert {
+public class MainExampleTest {
 
     @Test
     public void testMain() throws Exception {
diff --git 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainIoCTest.java
 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainIoCTest.java
index b5a8df1..3fb1348 100644
--- 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainIoCTest.java
+++ 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainIoCTest.java
@@ -18,10 +18,9 @@ package org.apache.camel.spring;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class MainIoCTest extends Assert {
+public class MainIoCTest {
 
     @Test
     public void testMain() throws Exception {
diff --git 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainTest.java
 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainTest.java
index 710839f..41bd1a8 100644
--- 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainTest.java
+++ 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainTest.java
@@ -22,12 +22,11 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class MainTest extends Assert {
+public class MainTest {
     private static final Logger LOG = LoggerFactory.getLogger(MainTest.class);
 
     @Test
diff --git 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainVetoTest.java
 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainVetoTest.java
index f6f8add..5a2cdab 100644
--- 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainVetoTest.java
+++ 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MainVetoTest.java
@@ -16,10 +16,11 @@
  */
 package org.apache.camel.spring;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class MainVetoTest extends Assert {
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class MainVetoTest {
 
     @Test
     public void testMain() throws Exception {
diff --git 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MisspelledRouteRefTest.java
 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MisspelledRouteRefTest.java
index a93cf32..32d48a4 100644
--- 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/MisspelledRouteRefTest.java
+++ 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/MisspelledRouteRefTest.java
@@ -18,12 +18,13 @@ package org.apache.camel.spring;
 
 import org.apache.camel.CamelException;
 import org.apache.camel.RuntimeCamelException;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-import static org.apache.camel.test.junit4.TestSupport.assertIsInstanceOf;
+import static org.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
 
-public class MisspelledRouteRefTest extends Assert {
+public class MisspelledRouteRefTest {
 
     @Test
     public void testApplicationContextFailed() throws Exception {
diff --git 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/SpringMainStartFailedIssueTest.java
 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/SpringMainStartFailedIssueTest.java
index 67f70f7..f10c5b6 100644
--- 
a/components/camel-spring-main/src/test/java/org/apache/camel/spring/SpringMainStartFailedIssueTest.java
+++ 
b/components/camel-spring-main/src/test/java/org/apache/camel/spring/SpringMainStartFailedIssueTest.java
@@ -17,8 +17,12 @@
 package org.apache.camel.spring;
 
 import org.apache.camel.FailedToCreateRouteException;
-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.apache.camel.test.junit5.TestSupport.assertIsInstanceOf;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.fail;
 
 public class SpringMainStartFailedIssueTest extends CamelTestSupport {
 
@@ -34,6 +38,6 @@ public class SpringMainStartFailedIssueTest extends 
CamelTestSupport {
             assertIsInstanceOf(FailedToCreateRouteException.class, e);
         }
 
-        assertNull("Spring application context should NOT be created", 
main.getApplicationContext());
+        assertNull(main.getApplicationContext(), "Spring application context 
should NOT be created");
     }
 }

Reply via email to