spring集成junit类报错:java.lang.Exception: No runnable methods

出现以下报错:
spring集成junit类报错:java.lang.Exception: No runnable methods_第1张图片
报错信息:

Runner org.junit.internal.runners.ErrorReportingRunner (used on class com.sl.test.Test03) does not support filtering and will therefore be run completely.
java.lang.Exception: No runnable methods
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
at org.junit.runners.ParentRunner.(ParentRunner.java:84)
at org.junit.runners.BlockJUnit4ClassRunner.(BlockJUnit4ClassRunner.java:65)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.(SpringJUnit4ClassRunner.java:137)
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:422)

解决方法:

导包出现错误:
错误的导包为:import org.junit.jupiter.api.Test;
正确的导包为:import org.junit.Test;

你可能感兴趣的:(SSM,java,spring,intellij-idea)