2.12.3.2. 使用 JVM 系统属性启用路由覆盖范围
您可以打开 JVM 系统属性 CamelTestRouteCoverage,以启用对所有测试用例的路由覆盖。这可以在 maven-surefire-plugin 的配置中进行:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<CamelTestRouteCoverage>true</CamelTestRouteCoverage>
</systemPropertyVariables>
</configuration>
</plugin>
在运行测试时从命令行中:
mvn clean test -DCamelTestRouteCoverage=true