整合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

相关推荐
Nturmoils15 小时前
订单列表慢查询,先看 WHERE、ORDER BY 和 LIMIT
数据库
渣波19 小时前
拒绝 SQL 焦虑!手把手带你用 NestJS + Prisma + DTO 写出“防弹”级后端代码
javascript·数据库·后端
倔强的石头_2 天前
KingbaseES 新版MySQL 兼容版体验:旧版迁移 + 功能实测
数据库
倔强的石头_5 天前
《Kingbase护城河》——数据库存储空间全景探测与精细化瘦身实战
数据库
冬奇Lab5 天前
每日一个开源项目(第134篇):Zvec - 阿里开源的嵌入式向量数据库,向量搜索界的 SQLite
数据库·人工智能·llm
ClouGence6 天前
Oracle CDC 架构优化:从主库直连到 DataGuard 备库同步
数据库·后端·oracle
无响应de神6 天前
三、用户与权限管理
数据库·mysql
麦聪聊数据7 天前
数据服务化时代:企业数据能力输出的核心路径
数据库
shushangyun_7 天前
2026年快消品B2B系统推荐:支持终端门店订货、促销政策自动化的工具?
java·运维·网络·数据库·人工智能·spring·自动化
DARLING Zero two♡7 天前
【MySQL数据库】数据类型与表约束
数据库·mysql