【发布时间】:2021-02-16 09:53:20
【问题描述】:
在我的项目(springboot、maven)中,我使用@TestPropertySource({"classpath:flyway.properties", "/queries/test.properties"}) 注释的测试来覆盖与我的数据源相关的一些属性。
我使用mvn clean test 命令运行测试。
现在我想在我的 Jenkins 管道中添加一个新阶段,以便对两个不同的数据源执行测试。
当我运行 maven 命令时,有没有办法覆盖我的文件 (test.properties) 中的值?或者我可以使用两个不同的文件与弹簧配置文件或类似的东西:
@TestPropertySource({"classpath:flyway.properties", "/queries/test-${env/profile}.properties"})
任何见解将不胜感激。干杯!
【问题讨论】:
标签: java spring maven testing datasource