lundi 6 février 2017

Multiple Profiles For Spring Integration Tests?

I need different profiles for a few things. First we have the issue of my databases. When I run local tests I expect to use one datasource. When I run an acceptance profile (for a CI acceptance build), I expect to use a different datasource. Finally, when I run acceptance not in test I expect to use a third datasource. How I imagined this would work is.

/src/main/resources/application.properties
/src/main/resources/application-acceptance.properties
/src/test/resources/application-test.properties
/src/test/resources/application-acceptance-test.properties

However when I run mvn clean install -Dspring.profiles.active=acceptance it does not run the application-accepatnce-test.properties.

Finally, I would like to be able to run a mvn install while running the tests but not the integrations test. For this I imagine I would add a -Dspring.profiles.active=nointegration and then simply add an @ActiveProfiles('!nointegration') on the integration tests.

I've had no luck with either of these. Is it even possible to get profiles on test runs?

If it helps I am using Spring Boot 1.3.0.RELEASE.

Aucun commentaire:

Enregistrer un commentaire