springboot知识点补充(一)
2024-10-16 12:58:21
测试配置
@RunWith(SpringRunner.class)
@SpringBootTest
@Configuration
@ActiveProfiles("test")
public class ApplicationTests {
@Test
public void test() {
}
}
- 测试类集成此类就可以实现读取测试的配置文件application-test.properties
- 在application.properties中配置spring.profiles.active=dev,就可以读取application-dev.properties配置文件信息,在application.properties中可以写一些公共配置,dev中写特殊配置
idea热加载工具devtools工具生效
- 首先加pom
<!-- SpringBoot自带热加载开发工具 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
- 在idea选项Compiler中把Build project automatically打钩
- 再快捷键shift+command+alt+/ 再选择registry,把compiler.automake.allow.when.app.running勾上
最新文章
- spring remoting源码分析--Hessian分析
- Python环境配置安装
- CocoaPods pod install/pod update更新慢的问题
- navicat 快捷键
- javascript语句——表达式语句、块语句、空语句和声明语句
- web.xml中配置固定数据
- DDL和DML的定义和区别
- Tinymce4 中Ajax多次加载时,会出现菜单在第二次进入时,显示的下拉菜单在左上角
- libeXosip2(2-3) -- eXosip2 event API
- 《On Writing Well 30th Anniversa》【PDF】下载
- 企业内部DNS跨国配置案例
- day_44_Django
- php面试题整理(一)
- 开发更健壮python程序的一些工具
- input时间表单默认样式修改(input[type=";date";])
- CentOS6.5在虚拟机中安装
- Atom编辑器中安装Emmet插件失败的问题
- Java并发编程笔记之ThreadLocal内存泄漏探究
- Typescript学习总结之模块
- @Autowired用法详解
热门文章
- mongodb mongod 启动参数
- node起一个简单服务,打开本地项目或文件浏览
- tensorflow报错error,tf.concat Expected int32, got list containing Tensors of type &#39;_Message&#39; instead
- 小程序微信支付java
- DB2在dbvisualizer 客户端执行begi/end 语句块
- PHP错误日志记录:display_errors与log_errors的区别
- apache禁止IP访问网站
- 【APP测试(Android)】--客户端数据库
- 转载-对js中new、prototype的理解
- NFS服务简介与配置