@TestPropertySource with dynamic properties

前端 未结 1 485
情书的邮戳
情书的邮戳 2020-12-31 14:50

I am using @TestPropertySource to overwrite application.yml properties in my integration test for a spring boot app.

@TestPropertySource(properties = { \"rep         


        
相关标签:
1条回答
  • 2020-12-31 15:43

    @TestPropertySource only provides declarative mechanisms for configuring PropertySources. Documentation in Spring Reference Manual.

    If you need programmatic support for adding a PropertySource to the Environment, you should implement an ApplicationContextInitializer which can be registered via @ContextConfiguration(initializers = ...). Documentation in Spring Reference Manual.

    Regards,

    Sam (author of the Spring TestContext Framework)

    0 讨论(0)
提交回复
热议问题