"CAMEL-15485:Migrate camel-spring-boot-examples to use JUnit 5 style"
diff --git a/camel-example-spring-boot-activemq/pom.xml b/camel-example-spring-boot-activemq/pom.xml
index 3577892..7075ebe 100644
--- a/camel-example-spring-boot-activemq/pom.xml
+++ b/camel-example-spring-boot-activemq/pom.xml
@@ -88,8 +88,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-test-spring</artifactId>
- <version>${camel-version}</version>
+ <artifactId>camel-test-spring-junit5</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/camel-example-spring-boot-activemq/src/test/java/sample/camel/SampleAmqApplicationTests.java b/camel-example-spring-boot-activemq/src/test/java/sample/camel/SampleAmqApplicationTests.java
index 4243bda..d95b860 100644
--- a/camel-example-spring-boot-activemq/src/test/java/sample/camel/SampleAmqApplicationTests.java
+++ b/camel-example-spring-boot-activemq/src/test/java/sample/camel/SampleAmqApplicationTests.java
@@ -20,21 +20,23 @@
import org.apache.camel.CamelContext;
import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.junit.Ignore;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
+import org.apache.camel.test.spring.junit5.EnableRouteCoverage;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.Assert.assertTrue;
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
@SpringBootTest(classes = SampleAmqApplication.class)
public class SampleAmqApplicationTests {
@Autowired
private CamelContext camelContext;
- @Ignore("Requires a running activemq broker")
+ @Disabled("Requires a running activemq broker")
public void shouldProduceMessages() throws Exception {
NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create();
diff --git a/camel-example-spring-boot-amqp/pom.xml b/camel-example-spring-boot-amqp/pom.xml
index 77e7e7f..6e1dcbb 100644
--- a/camel-example-spring-boot-amqp/pom.xml
+++ b/camel-example-spring-boot-amqp/pom.xml
@@ -99,8 +99,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-test-spring</artifactId>
- <version>${camel-version}</version>
+ <artifactId>camel-test-spring-junit5</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/camel-example-spring-boot-amqp/src/test/java/sample/camel/SampleAmqApplicationTests.java b/camel-example-spring-boot-amqp/src/test/java/sample/camel/SampleAmqApplicationTests.java
index 4243bda..f71c368 100644
--- a/camel-example-spring-boot-amqp/src/test/java/sample/camel/SampleAmqApplicationTests.java
+++ b/camel-example-spring-boot-amqp/src/test/java/sample/camel/SampleAmqApplicationTests.java
@@ -20,21 +20,22 @@
import org.apache.camel.CamelContext;
import org.apache.camel.builder.NotifyBuilder;
-import org.apache.camel.test.spring.CamelSpringBootRunner;
-import org.junit.Ignore;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
+import org.apache.camel.test.spring.junit5.EnableRouteCoverage;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Disabled;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import static org.junit.Assert.assertTrue;
-@RunWith(CamelSpringBootRunner.class)
+@CamelSpringBootTest
@SpringBootTest(classes = SampleAmqApplication.class)
public class SampleAmqApplicationTests {
@Autowired
private CamelContext camelContext;
- @Ignore("Requires a running activemq broker")
+ @Disabled("Requires a running activemq broker")
public void shouldProduceMessages() throws Exception {
NotifyBuilder notify = new NotifyBuilder(camelContext).whenDone(1).create();
diff --git a/camel-example-spring-boot-geocoder/pom.xml b/camel-example-spring-boot-geocoder/pom.xml
index 8535397..b1d629e 100644
--- a/camel-example-spring-boot-geocoder/pom.xml
+++ b/camel-example-spring-boot-geocoder/pom.xml
@@ -91,10 +91,9 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.apache.camel</groupId>
- <artifactId>camel-test</artifactId>
- <version>${camel-version}</version>
+ <artifactId>camel-test-spring-junit5</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
diff --git a/camel-example-spring-boot-geocoder/src/test/java/org/apache/camel/example/springboot/geocoder/ApplicationTest.java b/camel-example-spring-boot-geocoder/src/test/java/org/apache/camel/example/springboot/geocoder/ApplicationTest.java
index 7df248c..70e3234 100644
--- a/camel-example-spring-boot-geocoder/src/test/java/org/apache/camel/example/springboot/geocoder/ApplicationTest.java
+++ b/camel-example-spring-boot-geocoder/src/test/java/org/apache/camel/example/springboot/geocoder/ApplicationTest.java
@@ -18,8 +18,9 @@
import com.google.maps.model.GeocodingResult;
import org.apache.camel.CamelContext;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
+import org.apache.camel.test.spring.junit5.EnableRouteCoverage;
+import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -28,12 +29,12 @@
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
-import org.springframework.test.context.junit4.SpringRunner;
+
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertNotNull;
-@RunWith(SpringRunner.class)
+@CamelSpringBootTest
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class ApplicationTest {
diff --git a/camel-example-spring-boot-rest-jpa/pom.xml b/camel-example-spring-boot-rest-jpa/pom.xml
index bc3e069..6160184 100644
--- a/camel-example-spring-boot-rest-jpa/pom.xml
+++ b/camel-example-spring-boot-rest-jpa/pom.xml
@@ -126,7 +126,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-spring-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/camel-example-spring-boot-rest-jpa/src/test/java/org/apache/camel/example/spring/boot/rest/jpa/ApplicationTest.java b/camel-example-spring-boot-rest-jpa/src/test/java/org/apache/camel/example/spring/boot/rest/jpa/ApplicationTest.java
index c50308c..b0fd59a 100644
--- a/camel-example-spring-boot-rest-jpa/src/test/java/org/apache/camel/example/spring/boot/rest/jpa/ApplicationTest.java
+++ b/camel-example-spring-boot-rest-jpa/src/test/java/org/apache/camel/example/spring/boot/rest/jpa/ApplicationTest.java
@@ -21,9 +21,10 @@
import org.apache.camel.CamelContext;
import org.apache.camel.builder.NotifyBuilder;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.apache.camel.test.spring.junit5.CamelSpringBootTest;
+import org.apache.camel.test.spring.junit5.EnableRouteCoverage;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Disabled;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
@@ -32,13 +33,13 @@
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
-import org.springframework.test.context.junit4.SpringRunner;
+
import static org.assertj.core.api.Assertions.assertThat;
-@RunWith(SpringRunner.class)
+@CamelSpringBootTest
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
-@Ignore("TODO: Fix me")
+@Disabled("TODO: Fix me")
public class ApplicationTest {
@Autowired