spring boot 整合junit

发布时间:2026-02-24 23:46

1,添加起步依赖

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

2,在测试类中加上

@SpringBootTest注解

@RunWith(SpringRunner.class)

测试方法上加@Test

免责声明:本内容来自平台创作者,博客园系信息发布平台,仅提供信息存储空间服务。

0

0

posted @ 2021-08-30 14:57  在线电影制作人  阅读(4)  评论(0)    收藏  举报  来源

网址:spring boot 整合junit https://m.mxgxt.com/news/view/2013367

相关内容

基于Spring Boot搭建星之语明星周边销售网站(附源码免费下载)
Spring Cloud Stream
国外vps中Neo4j与Spring框架集成如何进行
SpingBoot:整合Elasticsearch7.2.0
Ed Hardy X Spring 2019明星早春穿搭示范
JUnit 4 TestSuite Declaration · Los Techies
《战地6》强制要求开启TPM 2.0和Secure Boot,附检查方法
小石头哥 (bwoa)
大数据职业发展路线图谱
spring的事务是什么?与数据库的事务是否一样

随便看看