整合junit与热部署

整合junit

复制代码
<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>2.7.0</version>
        </dependency>

测试类上添加@SpringBootTest

如:

注意测试类的目录与主启动类的目录一致,测试方法中添加@Test

热部署(idea)

1、添加spring-boot-devtools热部署启动器

复制代码
<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>

2、file-settings-compiler-勾选Build project automatically

3、ctrl+shift+alt+/ 打开Maintenance中registry,选中...when.app.running

相关推荐
li35741 小时前
从“内存操作”到“原子更新”:一次代码思维的跃迁
数据库·oracle
瀚高PG实验室1 小时前
执行select * from a where rownum<1;,数据库子进程崩溃,业务中断。
数据库·sql·瀚高数据库
小白考证进阶中1 小时前
终于赶在考试券过期前把Oracle OCP证书考下来了!
运维·数据库·oracle·dba·开闭原则·数据库管理员
DCTANT2 小时前
【报错记录】OpenGauss/磐维数据库连接报:org.postgresql.util.PSQLException: 致命错误: 账户被锁定
数据库·postgresql
keep__go2 小时前
postgresql9.2.4 跨版本升级14.6
linux·运维·数据库·postgresql
Doris_LMS2 小时前
Git的强软硬回退(三)
运维·服务器·数据库·git·idea
williamdsy3 小时前
【postgresql】JPA LIKE 查询触发 PostgreSQL `text ~~ bytea` 报错的排查与最佳实践
数据库·postgresql
川石课堂软件测试3 小时前
Oracle 数据库如何查询列
linux·数据库·sql·功能测试·oracle·grafana·prometheus
2501_927030785 小时前
NOSQL——Redis
数据库·nosql
光电的一只菜鸡5 小时前
ubuntu之坑(十九)——VMware虚拟机扩容磁盘
linux·数据库·ubuntu