为了账号安全,请及时绑定邮箱和手机立即绑定

向廖老师请教:测试girlList时总出现这样错误

八月 17, 2020 7:08:21 下午 org.junit.platform.launcher.core.DefaultLauncher handleThrowable

警告: TestEngine with ID 'junit-jupiter' failed to discover tests

java.lang.NoSuchMethodError: org.junit.platform.engine.EngineDiscoveryRequest.getDiscoveryListener()Lorg/junit/platform/engine/EngineDiscoveryListener;

at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:88)

at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:82)

at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)

at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:45)

at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)

at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:168)

at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:155)

at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)

at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)

at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)

at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)

at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)


八月 17, 2020 7:08:21 下午 org.junit.platform.launcher.core.DefaultLauncher handleThrowable

警告: TestEngine with ID 'junit-vintage' failed to discover tests

java.lang.NoSuchMethodError: org.junit.platform.engine.EngineDiscoveryRequest.getDiscoveryListener()Lorg/junit/platform/engine/EngineDiscoveryListener;

at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:88)

at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:82)

at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)

at org.junit.vintage.engine.discovery.VintageDiscoverer.discover(VintageDiscoverer.java:44)

at org.junit.vintage.engine.VintageTestEngine.discover(VintageTestEngine.java:63)

at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:168)

at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:155)

at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)

at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)

at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)

at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)

at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)


正在回答

1 回答

自己找到原因了,是GirlControllerTest类中以下导入语句不对

import org.junit.jupiter.api.Test;应该改成:import org.junit.Test;,这样就不会出现上面的错误


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

向廖老师请教:测试girlList时总出现这样错误

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信