PIT 测试 - 需要从报告中排除某些包

PIT testing - need to exclude certain packages from the report

我正在尝试生成 PIT 测试覆盖率报告,我需要排除某个包。 这些是使用的配置:

<plugin>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-maven</artifactId>
                        <version>1.3.0</version>
                        <configuration>
                            <targetClasses>
                                <param>test.presentation.*</param>
                                <param>test.service.impl.*</param>
                            </targetClasses>
                            <targetTests>
                                <param>test.App.ServletInitializerTest</param>
                                <param>test.presentation.AuthenticationControllerTest</param>
                                <param>test.service.impl.AuthenticationServiceImplTest</param>
                            </targetTests>
                            <excludedClasses>
                                <param>test.security.AuthenticationSecurityServiceImpl</param>
                                <param>test.security.TokenAuthenticationFilter</param>
                                <param>test.security.TokenInfo</param>
                                <param>test.security.TokenManagerImpl</param>
                            </excludedClasses>
                            <excludedTestClasses>
                                <param>test.security.AuthenticationSecurityServiceImplTest</param>
                            </excludedTestClasses>
                            <excludedMethods>
                            <param>test.service.impl.AuthenticationServiceImpl.userAuthentication</param>
                            </excludedMethods>
                            <avoidCallsTo>
                            <avoidCallsTo>test.service.impl.AuthenticationServiceImpl</avoidCallsTo>
                            <avoidCallsTo>test.security.*</avoidCallsTo>
                            </avoidCallsTo>
                        </configuration>
                    </plugin>

但我的报告仍然显示 test.security.* 包和 test.service.impl.AuthenticationServiceImpl.userAuthentication 方法的覆盖率。

如何在覆盖率报告中跳过这个包和方法?

您应该能够从

的突变中排除 test.security.*
<excludedClasses>
 <param>test.security.*</param>
</excludedClasses>

您在 avoidCallsTo 中的条目将防止对调用 test.security 中的方法的其他包中的代码行进行突变。*