Spring boot-测试类-启动报错【java.lang.Exception: No runnable methods】的解决办法

导入这个

import org.junit.jupiter.api.Test; 

报错

七月 04, 2020 12:54:50 下午 org.junit.vintage.engine.descriptor.RunnerTestDescriptor warnAboutUnfilterableRunner 警告: Runner org.junit.internal.runners.ErrorReportingRunner (used on class com.nowcoder.community.CommunityApplicationTests) does not support filtering and will therefore be run completely.     org.junit.runners.model.InvalidTestClassError: Invalid test class 'com.nowcoder.community.CommunityApplicationTests':   1. No runnable methods  	at org.junit.runners.ParentRunner.validate(ParentRunner.java:525) 	at org.junit.runners.ParentRunner.<init>(ParentRunner.java:92) 	at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:74) 	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:137) 	at org.springframework.test.context.junit4.SpringRunner.<init>(SpringRunner.java:49) 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 	at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) 	at org.junit.vintage.engine.discovery.DefensiveAllDefaultPossibilitiesBuilder$DefensiveAnnotatedBuilder.buildRunner(DefensiveAllDefaultPossibilitiesBuilder.java:114) 	at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) 	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70) 	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:37) 	at org.junit.vintage.engine.discovery.DefensiveAllDefaultPossibilitiesBuilder.runnerForClass(DefensiveAllDefaultPossibilitiesBuilder.java:57) 	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:70) 	。。。 	。。。 	。。。 

导入这个

import org.junit.Test; 

正确

Spring boot-测试类-启动报错【java.lang.Exception: No runnable methods】的解决办法

区块链毕设网(www.qklbishe.com)全网最靠谱的原创区块链毕设代做网站
部分资料来自网络,侵权联系删除!
资源收费仅为搬运整理打赏费用,用户自愿支付 !
qklbishe.com区块链毕设代做网专注|以太坊fabric-计算机|java|毕业设计|代做平台 » Spring boot-测试类-启动报错【java.lang.Exception: No runnable methods】的解决办法

提供最优质的资源集合

立即查看 了解详情