Spring Boot Integration Tests override custom .properties file
Spring Boot Integration Tests override custom .properties file I am implementing integration tests and I have a problem with overriding custom properties that my application use. Integration test sample: @RunWith(SpringRunner.class) @SpringBootTest( classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT ) @TestPropertySource(locations = "classpath:test.properties") public abstract class BaseIntegrationTest { @Autowired protected TestRestTemplate restClient; The @TestPropertySource(locations = "classpath:test.properties") will override application.properties of my application with one that is provided @TestPropertySource(locations = "classpath:test.properties") application.properties However, my application use custom property file like this: @Configuration @PropertySource("classpath:fileProvider/custom.properties") @ConfigurationProperties(prefix = "com.sample.config") public class Sample...