2.12.3.5. 生成路由覆盖报告
要生成路由覆盖报告,使用以下方法运行单元测试:
mvn test
然后,您可以运行这个目标来报告路由覆盖率,如下所示:
mvn camel:route-coverage
报告在精确的源代码行报告时缺少路由覆盖率:
[INFO] --- camel-maven-plugin:2.21.0:route-coverage (default-cli) @ camel-example-spring-boot-xml ---
[INFO] Discovered 1 routes
[INFO] Route coverage summary:
File: src/main/resources/my-camel.xml
RouteId: hello
Line # Count Route
------ ----- -----
28 1 from
29 1 transform
32 1 filter
34 0 to
36 1 to
Coverage: 4 out of 5 (80.0%)
在这里,我们可以看到计算列中的 2 最后一行包含 0, 因此没有涵盖。我们还可以看到,源代码文件中为 34 行,它位于 my-camel.xml XML 文件中。