1.pom文件添加jar
<!-- 添加junit环境的jar包 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
2.编写测试类
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes={App.class})
public class TestDemo {
@Test
public void test(){
System.out.println("测试。。。。。。。");
}
}