Monday, August 24, 2015

How to override Spring Boot application.properties in tests

To override Spring Boot application.properties in tests,

use the following annotations:

@TestPropertySource(properties = {"spring.cache.type=simple"})
@DirtiesContext

References:
http://stackoverflow.com/questions/29669393/override-default-spring-boot-application-properties-settings-in-junit-test
https://github.com/spring-projects/spring-boot/issues/2198

No comments:

Post a Comment