During the maven package phase I build a docker image of my application:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${version.dockerfile-plugin}</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>archetype/thorntail</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>${project.build.finalName}-thorntail.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>
In my integration test I use this image of my app as follows:
@Container
private static GenericContainer apiContainer =
new GenericContainer("archetype/thorntail:0")
.withExposedPorts(THORNTAIL_WEB_PORT)
.waitingFor(
Wait.forHttp("/base/api/hello")
);
My question: How can I signal my container that it is running in an integration test and should therefore use a different database e.g. H2?