Since 0.22.3 the tests don't work anymore when using
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.0'
in my build.gradle file.
It generates the following error:
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineDiscoveryListener
it works again when I downgrade to 0.22.2, I guess it might be related to #970 but I'm not sure.
I also tried to change the testImplementation line to 'org.junit.jupiter:junit-jupiter:5.6.0' and now it works with the 0.22.3 version.
The problem I have is that it's a big project and I can't change the testImplementation line just because I have a problem with an IDE extension.
I can also reproduce this bug in Eclipse 2020-03.
~I've created a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=561797~
Update: It turns out that it's a bug for buildship: https://github.com/eclipse/buildship/issues/980
Below are several workarounds before the upstream fixed this issue:
org.junit.jupiter:junit-jupiter to 5.6.0testImplementation('org.junit.platform:junit-platform-launcher:1.5.2')0.22.2You can choose one of the above three to workaround the issue.
I downgraded java test runner from 0.22.3 to 0.22.2. Still get same problem
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: org/junit/platform/engine/EngineDiscoveryListener
when running test.
Compiles and runs on command line (a test does fail so would like to debug)
Downgrading the extension to 0.22.2 didn't help, but adding testImplementation('org.junit.platform:junit-platform-launcher:1.5.2') fixed the issue.
Even downgrade the extension or upgrade jupiter version not help, just add [testImplementation 'org.junit.platform:junit-platform-launcher:1.5.2'] and version MUST 1.5.2, 1.7.0 not work too
Upgrade the
org.junit.jupiter:junit-jupiterto5.6.0
Worked for us.
Upgrade the
org.junit.jupiter:junit-jupiterto5.6.0
Worked for us as well in a Maven project.
Make sure that there aren't any dependencies in your dependency tree that are transitively causing some of the JUnit versions to be lowered. For example, having both spring-boot-starter-test and junit-jupiter can cause situations like the following, where the main JUnit libraries are on 5.6.2, but the JUnit platform engine is on 1.5.2 instead of 1.6.2:

Even downgrade the extension or upgrade jupiter version not help, just add [testImplementation 'org.junit.platform:junit-platform-launcher:1.5.2'] and version MUST 1.5.2, 1.7.0 not work too
it work! thanks
Adding testImplementation('org.junit.platform:junit-platform-launcher:1.5.2')
worked for me 馃憤馃徎
junit-platform-launcher:1.7.1 seems to work fine now
Most helpful comment
Below are several workarounds before the upstream fixed this issue:
org.junit.jupiter:junit-jupiterto5.6.0testImplementation('org.junit.platform:junit-platform-launcher:1.5.2')0.22.2You can choose one of the above three to workaround the issue.