如何在Java Spring Boot项目中忽略数据模型和DTO的测试覆盖率

huangapple go评论77阅读模式
英文:

How to ignore test coverage from data model and dto from Java spring boot project

问题

如何忽略所有模型文件和DTO文件的测试覆盖率?我在项目中使用JUnit编写单元测试。所有方法和类都已覆盖,除了模型和DTO文件。每个类的覆盖率都非常高,但项目的覆盖率稍低,因为所有模型和DTO文件。如何忽略它们以提高测试覆盖率?

英文:

How can I ignore all model files and dto files from test coverage ? I use junit to write unit test in my project. All methods and classes has been coverage except model and dto files. The coverage of each class is very high but the project is low litter bit because all model and dto file. How can I ignore them to set the test coverage is higher ?

答案1

得分: 2

以下是要翻译的内容:

检查这些参考资料,显示了如何在jacoco插件中设置排除项。

maven-jacoco-config

gradle-jacoco-config

英文:

Check these references, shows how you need to set your exclusions in jacoco plugin

maven-jacoco-config

gradle-jacoco-config

huangapple
  • 本文由 发表于 2020年8月9日 01:42:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/63318476.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定