CONTAINERS field of type
DockerComposeContainer allows TestContainers to start containers from a Docker Compose file.
Due to a peculiarities in how TestContainers supports Docker Compose, it may be necessary to explicitly await for containers to be exposed, or test executions can sometimes fail because a container port hasn't been exposed yet.
This can be done by calling the
withExposedService method, as in:
@Container private static final DockerComposeContainer CONTAINERS = new DockerComposeContainer(new File("../docker-compose.yml")) .withExposedService("mongo_1", 27017);
The changes have been applied to the samples source code repository at https://github.com/jponge/vertx-in-action.