我想知道是否@TestPropertySource会尊重 SpEL 或者至少允许一个属性替换另一个属性的值。
这是一个与动态属性 @TestPropertySource类似的问题
假设我所指的属性存在于属性中的文件之一中locations......
例如,如果我想做类似的事情:
@TestPropertySource(
locations = {"classpath:application.properties", "classpath:database.properties"},
properties = {"newPortNum = #{1 + Integer.parseInt(${myapp.web.server.port.ssl})}})
Run Code Online (Sandbox Code Playgroud)
或这个:
@TestPropertySource(
locations = {"classpath:application.properties", "classpath:database.properties"},
properties = {"outputFile = ${outputDir}/foo.txt"})
Run Code Online (Sandbox Code Playgroud)
我需要实施 aTestExecutionListener或@BootstrapWith来完成此任务吗?