public static ElasticsearchContainer provideElasticsearchContainer() {
        String esImageType = "docker.elastic.co/elasticsearch/elasticsearch";
        String esProvider = Optional.ofNullable(System.getenv("APIMAN_ES_PROVIDER"))
            .orElseGet(() -> System.getProperty("apiman.es.provider"));

        if ("opensearch".equalsIgnoreCase(esProvider)) {
            return new ElasticsearchContainer(DockerImageName.parse("opensearchproject/opensearch")
                .withTag(EsConstants.getEsVersion().getProperty("apiman.opensearch-version"))
                .asCompatibleSubstituteFor(esImageType))
                .withEnv("discovery.type", "single-node")
                .withEnv("DISABLE_INSTALL_DEMO_CONFIG", "true")
                .withEnv("DISABLE_SECURITY_PLUGIN", "true");
        }
        return new ElasticsearchContainer(DockerImageName.parse(esImageType)
            .withTag(EsConstants.getEsVersion().getProperty("apiman.elasticsearch-version")))
            .withEnv("xpack.security.enabled", "false");
    }
Provide a test container for elasticsearch based on a system property or environment variable.
Use apiman.es.provider=opensearch or APIMAN_ES_PROVIDER=opensearch

@return a testcontainer for elasticsearch tests
test/common/src/main/java/io/apiman/test/common/es/EsTestUtil.java