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");
}
}
就可以了