简体   繁体   中英

JUnit version warning on IntelliJ

I am trying to run a test method on IntelliJ but when I compile the code I get the warning reported below:

WARNING: TestEngine with ID 'junit-vintage' failed to discover tests
org.junit.platform.commons.JUnitException: Failed to parse version of junit:junit: 4.13.1
    at org.junit.vintage.engine.JUnit4VersionCheck.parseVersion(JUnit4VersionCheck.java:54)
    at org.junit.vintage.engine.JUnit4VersionCheck.checkSupported(JUnit4VersionCheck.java:37)
    at org.junit.vintage.engine.JUnit4VersionCheck.checkSupported(JUnit4VersionCheck.java:32)
    at org.junit.vintage.engine.VintageTestEngine.discover(VintageTestEngine.java:61)

After this warning the complier build successfully and the test works. (I am using gradle)

Code: img1

img2

img3

You have JUnit 4 and JUnit 5 declared in your build.gradle .

Remove the JUnit 4 dependency:

testImplementation('junit:junit:4.13')

And re-sync/re-import your project in IntelliJ.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM