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");
}
}

就可以了

上一篇:ide phpStorm 配置PHP路径并本地执行PHP脚本


下一篇:实现RunOnUiThread和RunOnUiThreadBlock