As for the testing, you should use from Spring 4.1 which will overwrite the properties defined in other places:
@TestPropertySource("classpath:application-test.properties")
Test property sources have higher precedence than those loaded from the operating system's environment or Java system properties as well as property sources added by the application like @PropertySource