SpringBoot单元测试写法
@RunWith(SpringRunner
.class)
@SpringBootTest
public class Test {
@Test
public void test() {
System
.out
.println("单元测试");
}
}
需要的pom依赖
<dependency>
<groupId>org.springframework.boot
</groupId>
<artifactId>spring-boot-starter-test
</artifactId>
<scope>test
</scope>
</dependency>
总结
如果觉得不错,可以点赞+收藏或者关注下博主。感谢阅读!
转载请注明原文地址: https://lol.8miu.com/read-20208.html