what am I doing?
I have an app that I want to test across different environments - dev, staging, etc
What I do?
I am using maven cargo
plugin to deploy application war to run integration tests.
What I need?
I need to my test to infer the spring.profiles.active
based on environment variable set by cargo like
<container>
<containerId>tomcat7x</containerId>
<systemProperties>
<spring.profiles.active>development</spring.profiles.active>
</systemProperties>
</container>
Why?
so that I can remove the hard coding in my Integration Test @ActiveProfiles("development")
and the test can infer what active profile is from environment variable
Question
- I found Spring integration tests with profile which mentions about using ActiveProfilesResolver
- I tried to find how can I make use of it, but could not find any resources
I am looking for guidance/recommendations on how to use ActiveProfilesResolver