springboot 2 to springboot 3 junit

代码覆盖率不够, junit4 test case没跑,只跑了junit5的case

每跑一个test.class都会有一个Running xxxx log

需要引入 vintage, springboot3 自动移掉了junit4 runner, 要加回来
https://www.baeldung.com/spring-boot-testing#1-junit-4

<dependency>
    <groupId>org.junit.vintage</groupId>
    <artifactId>junit-vintage-engine</artifactId>
    <scope>test</scope>
    <exclusions>
        <exclusion>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
        </exclusion>
    </exclusions>
</dependency>

并不是jacoco配置的问题 include exclude xxx, jacoco会自动移除包含generated的test case

jacoco report文件位置 target\site\jacoco\index.html

mvn -X 显示调试信息

posted @ 2024-07-09 15:50  funny_coding  阅读(5)  评论(0编辑  收藏  举报
build beautiful things, share happiness