I have spring application that uses three datasources, the details are stored in my application.properties file. I am looking to use environment variables for the usernames and passwords, see below:
spring.datasource1.username=${DB1_Username}
spring.datasource1.password=${DB1_Password}
This is works fine when i start the application normally but not when i run the tests. I get the following error when i try to run a test:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user '${DB1_Username}'.
Can environment variables not be used in the application.properties file when running tests? Or am i doing something stupid?