JUnit报错 java.lang.Exception:No tests found matching

@RunWith(SpringRunner.class)
@SpringBootTest
public class BusinessTest {
@Test
public void getList() {
System.out.println("aaaaaaaaaa");
}
}

改成

@RunWith(SpringRunner.class)
@SpringBootTest(classes=BusinessService.class)//这里的BusinessService.class指要测试的类
public class BusinessTest {
@Test
public void getList() {
System.out.println("aaaaaaaaaa");
}
}

就可以了

posted @ 2019-03-04 17:08  NA-CODE  阅读(1200)  评论(0编辑  收藏  举报