Reputation: 1306
With IntelliJ, I can specify a Spring boot profile to run when starting a service
However, if I run mvn clean install
, then the tests are run with the default profile, which causes them to fail. How can I tell mvn to run the tests with a specific Spring Boot profile?
Upvotes: 0
Views: 1639
Reputation: 972
Create/define a properties file and put it within your src/test/resources
folder.
Use class level annotation @ActiveProfiles
and specify your property file name like this @ActiveProfiles("myProperties")
Hope this helps!
Upvotes: 2