第一步 在POM.XML配置,引入依赖html
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency>
第二步 建立测试类,一如两个注解spring
@RunWith(SpringRunner.class)spring-boot
@SpringBootTest //须要制定应用测试
public class SpringBootTests{}htm