private static RestHighLevelClient createEsClient() {
        Map<String, String> config = new HashMap<>();
        config.put("client.protocol", "http");
        config.put("client.host", NODE.getHost());
        config.put("client.port", NODE.getFirstMappedPort().toString());
        config.put("client.initialize", "true");
        config.put("client.type", "es");

        // We want the metrics client to initialise its indexes and this is an easy way of doing that.
        // Normally it would be triggered at startup of the component, but we bypass it in these tests.
        EsMetrics metrics = new EsMetrics(config);
        System.out.println(metrics.getClient());

        return new DefaultEsClientFactory()
            .createClient(config,
                Collections.emptyMap(),
                APIMAN_METRICS_INDEX_NAME
            );
    }
Tests the elasticsearch metrics accessor.

@author eric.wittmann@redhat.com
manager/test/api/src/test/java/io/apiman/manager/test/es/EsMetricsAccessorTest.java