POM

  1. <dependency>
  2. <groupId>com.taobao.pandora</groupId>
  3. <artifactId>pandora-boot-test</artifactId>
  4. <scope>compile</scope>
  5. </dependency>

Java

  1. @RunWith(SpringRunner.class)
  2. @SpringBootTest(classes = RunwithTest.class)
  3. public class RunwithTest {
  4. @Test
  5. public void test(){
  6. System.out.println(11);
  7. }
  8. }

如果还是找不到

  • 使用dependency:tree检查是否引入junit 4.12成功,且scope状态是compile(而非test)
  • 在project - maven - reimport 后再检查看看。