新创建的JUNIT类未找到异常(未找到类com.pearson.aimswebplus.controller.TestNavAssignmentListControllerTest)

时间:2016-07-06 05:36:21

标签: java maven junit

我创建了一个java文件TestNavAssignmentListControllerTest。代码如下

public class TestNavAssignmentListControllerTest extends
        AimswebplusRosterAssesssQueringserverApplicationTests {
     @Autowired
        private TestnavAssignmentListController testnavAssignmentListController;

        @Test
        public void searchOk(){
            String params = "aimswebId=1168&roster=RCM3MA==&minGrade=0&maxGrade=7&measureCode=&type=&schoolYearVal=2015&benchmarkPeriodId=2&studentsWithNewStatus=0&page=0&size=0&sort=studentName&order=asc&username=manager&assignmentIds=1602,1723,1829,2437";
            TestnavAssignmentListDto listDto = (TestnavAssignmentListDto) when().get(BASE_URL + "/query/testnavAssignments?" + params) .as(TestnavAssignmentListDto.class);
            assertNotNull(listDto);
        }

当我尝试以Junit Test运行时,它会抛出

Class not found com.pearson.aimswebplus.controller.TestNavAssignmentListControllerTest
java.lang.ClassNotFoundException: com.pearson.aimswebplus.controller.TestNavAssignmentListControllerTest
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    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)

异常。

我开始研究:构建项目并编译项目(使用maven)

任何人都有这个想法请告诉我。

0 个答案:

没有答案