Containers take a varying amount of time to be ready. By default, Testcontainers will wait for the first mapped network port to be ready. However, for application servers the HTTP port may be available before the app is, so we want to wait for the app’s endpoint to be available before we start running tests. To accomplish this we use waitingFor(Wait.forHttp("/myservice")) , which will wait for http://<container_ip>:<container_port>/myservice to return HTTP 200 before allowing any tests to run. There are many different ways to customize container readiness checks. Refer to the official Testcontainers documentation on this topic for full details.