You can set your test properties in src/test/resources/config/application.yml
file. Spring Boot test cases will take properties from application.yml
file in test directory.
The config
folder is predefined in Spring Boot.
As per documentation:
If you do not like application.properties as the configuration file name, you can switch to another file name by specifying a spring.config.name environment property. You can also refer to an explicit location by using the spring.config.location environment property (which is a comma-separated list of directory locations or file paths). The following example shows how to specify a different file name:
java -jar myproject.jar --spring.config.location=classpath:/default.properties,classpath:/override.properties
The same works for application.yml
Documentation: