JUnit 5测试用例未执行

JUnit 5测试用例未执行,第1张

JUnit 5测试用例未执行

确保将您

maven-surefire-plugin
的配置正确地设置为:

<plugin>    <groupId>org.apache.maven.plugins</groupId>    <artifactId>maven-surefire-plugin</artifactId>    <version>2.19.1</version> <!-- Specific due to memory leak in 2.20 -->    <dependencies>         <!--Custom provider and engine for Junit 5 to surefire-->         <dependency>  <groupId>org.junit.platform</groupId>  <artifactId>junit-platform-surefire-provider</artifactId>  <version>1.0.1</version>         </dependency>         <dependency>  <groupId>org.junit.jupiter</groupId>  <artifactId>junit-jupiter-engine</artifactId>  <version>5.0.1</version>         </dependency>     </dependencies>     <configuration>         <argLine>${argLine}</argLine>     </configuration></plugin>

而且您不需要引擎作为依赖项,因此可以从

<dependencies>
标签中删除它:-

<dependency>    <groupId>org.junit.jupiter</groupId>    <artifactId>junit-jupiter-engine</artifactId>    <version>5.0.1</version>    <scope>test</scope></dependency>

注意 :Junit5的有关使用maven运行测试的官方文档指定使用surefire
2.19.1,因为该插件的2.20发行版中发生内存泄漏。



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5507104.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-13
下一篇 2022-12-13

发表评论

登录后才能评论

评论列表(0条)

保存