I'm writing integration tests, and I'd like to use Spring profiles to configure properties for each environment. However I'm finding profile specific application properties (e.g. application-dev.yml, application-prod.yml) in my src/test/resources directory aren't activated the same way they are in src/main/resources. It appears running tests with -Dspring.profiles.active=prod
has no effect. Is it possible to activate a profile from the command line for tests?
Note: @ActiveProfiles
isn't sufficient because I want to run the same tests against multiple environments.