I want to override properties defined in application.properties in tests, but @TestPropertySource only allows to provide predefined values.
What I need is to start a
As of Spring Framework 5.2.5 and Spring Boot 2.2.6 you can use Dynamic Properties in tests:
Dynamic Properties
@DynamicPropertySource static void dynamicProperties(DynamicPropertyRegistry registry) { registry.add("property.name", "value"); }