I have
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
in my pom.xml so my Spring Boot application attempts to connect to MongoDB on localhost when the application is started.
I also have
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<scope>test</scope>
</dependency>
so when I run unit tests the embedded MongoDb is used.
For the purpose of integration testing, I'd like to also use the embedded MongoDB if the application is started with the "test" active profile.
So effectively, I'd like to remove <scope>test</scope> from the embed dependency and have the the embed version used when the active profile is 'test'.
How can I achieve this?