@Test
    public void testElasticsearchDefaultMaxHeapSize() throws Exception {
        long defaultHeapSize = 2147483648L;

        try (ElasticsearchContainer container = new ElasticsearchContainer(ELASTICSEARCH_IMAGE)) {
            container.start();
            assertElasticsearchContainerHasHeapSize(container, defaultHeapSize);
        }
    }
From 6.8, we can optionally activate security with a default password.
modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java