这是我为我的应用程序声明Spring属性占位符的方式:
<context:property-placeholderlocation="classpath:config/base.properties,classpath:config/${target_env}.properties/>
当我将我的应用程序部署到Tomcat webserver时,我将目标环境作为参数
-Dtarget_env=dev.
但是当我编写JUnit测试用例时,如何设置目标环境值?
答案 0 :(得分:0)
我得到了答案。我们需要在eclipse中创建如下的环境变量:
在eclipse中:运行为 - &gt; &#34;运行配置&#34; - &GT;环境 - &gt;创建新的 - (variable = target_env,Value = dev)