@Test
    public void testGetClientUsagePerApi() throws Exception {
        EsMetricsAccessor metrics = new EsMetricsAccessor(client);

        // data exists - all data for JBossOverlord/s-ramp-api:1.0
        ClientUsagePerApiBean usagePerApi = metrics.getClientUsagePerApi("JBossOverlord", "dtgov", "1.0",
                parseDate("2015-01-01"), new DateTime().withZone(DateTimeZone.UTC));
        Assert.assertNotNull(usagePerApi);
        Map<String, Long> expectedData = new HashMap<>();
        expectedData.put("s-ramp-api", 29L);
        Assert.assertEquals(expectedData, usagePerApi.getData());

        usagePerApi = metrics.getClientUsagePerApi("JBossOverlord", "rtgov", "1.0",
                parseDate("2015-01-01"), new DateTime().withZone(DateTimeZone.UTC));
        Assert.assertNotNull(usagePerApi);
        expectedData = new HashMap<>();
        expectedData.put("s-ramp-api", 14L);
        Assert.assertEquals(expectedData, usagePerApi.getData());
    }
Test method for {@link EsMetricsAccessor#getClientUsagePerApi(String, String, String, DateTime, DateTime)
manager/test/api/src/test/java/io/apiman/manager/test/es/EsMetricsAccessorTest.java