【发布时间】:2016-10-26 11:25:46
【问题描述】:
我想知道@TestPropertySource 是否会支持SpEL,或者至少允许一个属性替换另一个属性的值。
与@TestPropertySource with dynamic properties类似的问题
假设我所指的属性存在于locations 属性中的一个文件中......
例如,如果我想做类似的事情:
@TestPropertySource(
locations = {"classpath:application.properties", "classpath:database.properties"},
properties = {"newPortNum = #{1 + Integer.parseInt(${myapp.web.server.port.ssl})}})
或者这个:
@TestPropertySource(
locations = {"classpath:application.properties", "classpath:database.properties"},
properties = {"outputFile = ${outputDir}/foo.txt"})
我需要实现TestExecutionListener 或@BootstrapWith 来完成此操作吗?
【问题讨论】:
标签: spring spring-boot spring-test