idea 使用junit5的坑。

idea 2016版本开始支持junit5,最好是2017.3。官方原文:
IntelliJ IDEA releases prior to IDEA 2017.3 bundle specific versions of JUnit 5. Thus, if you want to use a newer version of JUnit Jupiter, execution of tests within the IDE might fail due to version conflicts. In such cases, please follow the instructions below to use a newer version of JUnit 5 than the one bundled with IntelliJ IDEA.

2017.1.1版本解决办法。

org.junit.platform
junit-platform-launcher
1.0.0-M2
test


org.junit.jupiter
junit-jupiter-engine
5.0.0-M2
test


org.junit.vintage
junit-vintage-engine
4.12.0-M2
test

junit版本需要和idea版本对应。

参考链接:
https://www.jianshu.com/p/d04078355afc
https://junit.org/junit5/docs/current/user-guide/#running-tests-ide

你可能感兴趣的:(idea)