private void configureWaitStrategy() {
        List<Integer> exposedPorts = getExposedPorts();
        boolean boltExposed = exposedPorts.contains(DEFAULT_BOLT_PORT);
        boolean httpExposed = exposedPorts.contains(DEFAULT_HTTP_PORT);
        boolean onlyBoltExposed = boltExposed && !httpExposed;
        boolean onlyHttpExposed = !boltExposed && httpExposed;

        if (onlyBoltExposed) {
            this.waitStrategy =
                new WaitAllStrategy().withStrategy(WAIT_FOR_BOLT).withStartupTimeout(Duration.ofMinutes(2));
        } else if (onlyHttpExposed) {
            this.waitStrategy =
                new WaitAllStrategy().withStrategy(WAIT_FOR_HTTP).withStartupTimeout(Duration.ofMinutes(2));
        }
    }
Update the default Neo4jContainer wait strategy based on the exposed ports.
Still possible to override the startup timeout before starting the container via {@link WaitStrategy#withStartupTimeout(Duration)}.
modules/neo4j/src/main/java/org/testcontainers/containers/Neo4jContainer.java