找不到Spring启动测试类

时间:2016-05-13 13:37:12

标签: java spring spring-mvc testing spring-boot

使用Spring-boot时,在STS中使用Spring测试时遇到一些问题: 我写了一个空的测试类:

package com.movieGo.repo;
@Transactional
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = MovieGoApplication.class)
public class CinemaRepoTests {

}

我收到了classNotFound这样的错误:

Class not found com.movieGo.repo.CinemaRepoTests
java.lang.ClassNotFoundException: com.movieGo.repo.CinemaRepoTests
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)   
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:685)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:421)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

我错过了什么吗?我该如何解决这个问题?任何帮助表示赞赏。

0 个答案:

没有答案