@Test
    public void elasticsearchOssImage() throws IOException {
        try (
            // ossContainer {
            ElasticsearchContainer container = new ElasticsearchContainer(
                "docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2"
            )
            // }
        ) {
            container.start();
            Response response = getClient(container).performRequest(new Request("GET", "/"));
            assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200);
            // The OSS image does not have any feature under Elastic License
            assertThat(catchThrowable(() -> getClient(container).performRequest(new Request("GET", "/_xpack/"))))
                .as("We should not have /_xpack endpoint with an OSS License")
                .isInstanceOf(ResponseException.class);
        }
    }
From 6.8, we can optionally activate security with a default password.
modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java