在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{}

原文地址:https://www.cnblogs.com/wwh/p/10182983.html