当从2.1.6升级到SpringBootVersion2.2.4时,我遇到了问题。
问题设想:
我有一个弹簧引导测试,它使用bootstrap-test.proeprties和测试作为活动配置文件。bootstrap-test.properties还包括一些由application.properties配置文件定义的其他配置文件。
下面是示例代码:
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT})
@ActiveProfiles("test")
public class SampleTest {
@Test
public void sampleTest() {
}
}
//bootstrap-test.properties
spring.profiles.include=db在这里,出现在application-db.properties中的属性,文件没有加载,测试失败。这在spring版本2.1.x中运行得很好。是新启动中有什么变化了吗?
版本?
如果我将bootstrap-test.properties更改为application-test.properties,它就能正常工作。但是,我仍然需要引导文件,因为我有属性,需要在开始时加载。任何帮助都是非常感谢的。
发布于 2020-05-11 15:10:49
您所使用的春云版本是什么?在升级到引导2.2.4时,我们也遇到了同样的问题。您应该用引导2.2.4将spring云版本升级到Hoxton.SR1。
https://stackoverflow.com/questions/59965503
复制相似问题