在SpringBoot中使用测试

第一步 在POM.XML配置,引入依赖

 

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

第二步 创建测试类,一如两个注解

@RunWith(SpringRunner.class)

@SpringBootTest //需要制定应用

public class SpringBootTests{}

posted @ 2018-12-27 08:39  刀子道  阅读(243)  评论(0编辑  收藏  举报