@BeforeClass
    public static void setup() throws Exception {
        locale = Locale.getDefault();
        Locale.setDefault(Locale.US);

        NODE.start();

        // Delete, refresh and create new client
        client = createEsClient();
        AbstractClientFactory.deleteIndices(client);

        client.indices().flush(new FlushRequest().force(true), RequestOptions.DEFAULT);
        DefaultEsClientFactory.clearClientCache();
        // Because of the delete above, the metrics fields need reinitialising with the index
        client = createEsClient();

        // Load test
        loadTestData(client);

        client.indices().flush(new FlushRequest(APIMAN_METRICS_INDEX_NAME).force(true), RequestOptions.DEFAULT);
        DefaultEsClientFactory.clearClientCache();

        try {
            Thread.sleep(TimeUnit.SECONDS.toMillis(5));
        } catch (RuntimeException ignored) {}
    }
Tests the elasticsearch metrics accessor.

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