I added -Dspring.profiles.active=test to VM Options and then re-ran that configuration. It worked perfectly.
This can be set by
- Choosing
Run | Edit Configurations... - Go to the
Configurationtab - Expand the
Environmentsection to revealVM options