测试配置

@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工具生效

  1. 首先加pom
<!-- SpringBoot自带热加载开发工具 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
  1. 在idea选项Compiler中把Build project automatically打钩
  2. 再快捷键shift+command+alt+/ 再选择registry,把compiler.automake.allow.when.app.running勾上

最新文章

  1. spring remoting源码分析--Hessian分析
  2. Python环境配置安装
  3. CocoaPods pod install/pod update更新慢的问题
  4. navicat 快捷键
  5. javascript语句——表达式语句、块语句、空语句和声明语句
  6. web.xml中配置固定数据
  7. DDL和DML的定义和区别
  8. Tinymce4 中Ajax多次加载时,会出现菜单在第二次进入时,显示的下拉菜单在左上角
  9. libeXosip2(2-3) -- eXosip2 event API
  10. 《On Writing Well 30th Anniversa》【PDF】下载
  11. 企业内部DNS跨国配置案例
  12. day_44_Django
  13. php面试题整理(一)
  14. 开发更健壮python程序的一些工具
  15. input时间表单默认样式修改(input[type=&quot;date&quot;])
  16. CentOS6.5在虚拟机中安装
  17. Atom编辑器中安装Emmet插件失败的问题
  18. Java并发编程笔记之ThreadLocal内存泄漏探究
  19. Typescript学习总结之模块
  20. @Autowired用法详解

热门文章

  1. mongodb mongod 启动参数
  2. node起一个简单服务,打开本地项目或文件浏览
  3. tensorflow报错error,tf.concat Expected int32, got list containing Tensors of type &#39;_Message&#39; instead
  4. 小程序微信支付java
  5. DB2在dbvisualizer 客户端执行begi/end 语句块
  6. PHP错误日志记录:display_errors与log_errors的区别
  7. apache禁止IP访问网站
  8. 【APP测试(Android)】--客户端数据库
  9. 转载-对js中new、prototype的理解
  10. NFS服务简介与配置