IDEA中在Template模板中设置junit test的通用参数

在springboot项目中,src/test/resources目录下可以放一个application.properties文件,在运行junit test时,此文件中的值会自动覆盖src/main/resources下的key值。

但这还是不能满足我的需求,如果是多人合作开发junit test,那么src/test/resources/application.properties一个文件的配置通常不能满足每个开发的自有设置,怎么办?

 

教你一招在本地IDEA中设置junit 模板参数,这样,你本地任意一个junit test启动时,会自动带模板参数过来:

点击“Edit Configurations" -> Templates -> Junit -> Environment variables, 看截图:

 

 

posted on 2020-08-26 16:34  梦幻朵颜  阅读(1575)  评论(0编辑  收藏  举报