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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new bfb390a  Add route-coverage to this example
bfb390a is described below

commit bfb390afb1941c82ab82a80ed97c69915de4518c
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri May 7 09:15:37 2021 +0200

    Add route-coverage to this example
---
 spring-boot/pom.xml                                              | 6 ++++++
 spring-boot/readme.adoc                                          | 9 +++++++++
 .../src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java | 2 ++
 3 files changed, 17 insertions(+)

diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml
index c2e250c..affda41 100644
--- a/spring-boot/pom.xml
+++ b/spring-boot/pom.xml
@@ -103,6 +103,12 @@
             <artifactId>camel-test-spring-junit5</artifactId>
             <scope>test</scope>
         </dependency>
+        <!-- JMX is needed for route coverage testing -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-management</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/spring-boot/readme.adoc b/spring-boot/readme.adoc
index baf111d..6a3cf6f 100644
--- a/spring-boot/readme.adoc
+++ b/spring-boot/readme.adoc
@@ -37,6 +37,15 @@ curl -XGET -s http://localhost:8080/actuator/info
 
 See the `application.properties` to control what information to present in 
actuator.
 
+=== Route coverage
+
+This example has enabled testing with route coverage, which after running the 
test dumps a report, if you run:
+
+    mvn test camel-report:route-coverage
+
+See more details about route coverage at:
+https://camel.apache.org/manual/latest/camel-report-maven-plugin.html[camel-report-maven-plugin].
+
 === Help and contributions
 
 If you hit any problem using Camel or have some feedback, then please
diff --git 
a/spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java 
b/spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java
index 21c7a2a..511d93a 100644
--- a/spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java
+++ b/spring-boot/src/test/java/sample/camel/MyCamelApplicationJUnit5Test.java
@@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.NotifyBuilder;
 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;
@@ -30,6 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @CamelSpringBootTest
 @SpringBootTest(classes = MyCamelApplication.class)
+@EnableRouteCoverage
 public class MyCamelApplicationJUnit5Test {
 
     @Autowired

Reply via email to