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

相关推荐

  1. Spring Boot整合Junit

    2024-01-17 12:36:04       46 阅读
  2. Spring Boot整合Junit

    2024-01-17 12:36:04       56 阅读
  3. Spring Boot整合Junit

    2024-01-17 12:36:04       56 阅读
  4. Spring整合Junit4

    2024-01-17 12:36:04       50 阅读
  5. Spring 整合 MyBatis、Junit

    2024-01-17 12:36:04       44 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-17 12:36:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-17 12:36:04       101 阅读
  3. 在Django里面运行非项目文件

    2024-01-17 12:36:04       82 阅读
  4. Python语言-面向对象

    2024-01-17 12:36:04       91 阅读

热门阅读

  1. MySQL作业 (2)单表查询

    2024-01-17 12:36:04       49 阅读
  2. Redis 哨兵模式

    2024-01-17 12:36:04       46 阅读
  3. 机器学习之集成学习 XGBoost 附代码解析

    2024-01-17 12:36:04       48 阅读
  4. 数据分析平台哪个好

    2024-01-17 12:36:04       54 阅读
  5. 开箱即用之MyBatisPlus XML 自定义分页

    2024-01-17 12:36:04       54 阅读
  6. 记一次Log记录大对象导致的CPU异常和磁盘打满

    2024-01-17 12:36:04       54 阅读
  7. PHP 字符串面试题

    2024-01-17 12:36:04       61 阅读
  8. 什么是池化层?

    2024-01-17 12:36:04       53 阅读