junitbug实例1

最近在写dubbo,在用测试类测试dobboClient的时候,出现了一个问题:


java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=contextLoads], {ExactMatcher:fDisplayName=contextLoads(com.xuxiao.demo.SpringBoot11dubboClientApplicationTests)], {LeadingIdentifierMatcher:fClassName=com.xuxiao.demo.SpringBoot11dubboClientApplicationTests,fLeadingIdentifier=contextLoads]] from org.junit.internal.requests.ClassRequest@5fdcaa40
    at org.junit.internal.requests.FilterRequest.getRunner(FilterRequest.java:40)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createFilteredTest(JUnit4TestLoader.java:80)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:71)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:46)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:522)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

报错时并没有说明是我的代码出错,而是启动junit即报错。
嗯?springboot对junit支持一直不错,我也从来没遇到过这种问题。忙乎一会才搞定,tmd测试类少个权限修饰符。
class SpringBoot11dubboClientApplicationTests
这个的类名是不行的,要写成这样public class SpringBoot11dubboClientApplicationTests

你可能感兴趣的:(junitbug实例1)