I want to run UAT tests using Spring Boot. I want to run them on multiple configurations in parallel.
I will start by saying that I'm not sure if it's a good practice to run mvn test on the same project in parallel. But let's pretend I'll do that.
The suggestions I find on the internet for testing different configurations are:
- either have different profiles and put this in the base application.yml : spring.profiles.active=profilex
- either use environment variables instead of profiles
Both will not work with running in parallel: application.yml can't have different values at the same time, the same with environment variables.
Is there any kind of way to specify the profile with command line arguments, something like mvn test -DprofilesActive=profilex ? Or any other way?
EDIT - concrete example:
I have a REST service deployed on 2 servers.
I have a separate project for testing the REST service using Cucumber (so JUnit tests). This is a Spring Boot project. It takes the URL of the server where the REST service is deployed from application.yml (at the moment).
I want to run this test project in parallel twice , for each deployed REST service, meaning with the 1st URL and the 2nd URL.
I run it using mvn test.