1. Help Center
  2. Getting started

How to run from scratch my first integration test with Testcontainers Cloud?

Use the sample application from our Github testcontainers-java-repro.

Congratulations! You installed the Testcontainers Cloud Client app and got it running.

Let's use it to run your first integration test with Testcontainers Cloud.

Use the sample application that contains one JUnit test that will create and start a Redis container:

@Test
public void demonstration() { 
try (
GenericContainer<?> container = new GenericContainer("redis:6.0.5")
.withExposedPorts(6379)
) {
container.start();
}

Here's how to run the example:

# clone the repository
git clone https://github.com/testcontainers/testcontainers-java-repro.git && cd testcontainers-java-repro
# run the Maven build
./mvnw verify

When the build finishes and the test passes, please check the standard output that was produced. When Testcontainers connects to Docker, it prints out information about it. In your case the output should indicate that it is connected to Testcontainers Cloud:

03:59:07.483 [main] INFO  org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 66+testcontainerscloud
API Version: 1.41
Operating System: Alpine Linux v3.14 (containerized)
Total Memory: 32113 MB

Congratulations, you just run your first test utilizing Testcontainers Cloud.