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

        // s-ramp-api data
        ResponseStatsPerPlanBean stats = metrics.getResponseStatsPerPlan("JBossOverlord", "s-ramp-api", "1.0",
                parseDate("2015-06-01"), new DateTime().withZone(DateTimeZone.UTC));
        Map<String, ResponseStatsDataPoint> data = stats.getData();
        Assert.assertTrue(!data.isEmpty());
        ResponseStatsDataPoint point = data.get("Gold");
        Assert.assertNotNull(point);
        Assert.assertEquals(12L, point.getTotal());
        Assert.assertEquals(0L, point.getFailures());
        Assert.assertEquals(0L, point.getErrors());
        point = data.get("Silver");
        Assert.assertNotNull(point);
        Assert.assertEquals(16L, point.getTotal());
        Assert.assertEquals(0L, point.getFailures());
        Assert.assertEquals(3L, point.getErrors());
        point = data.get("Platinum");
        Assert.assertNotNull(point);
        Assert.assertEquals(17L, point.getTotal());
        Assert.assertEquals(0L, point.getFailures());
        Assert.assertEquals(0L, point.getErrors());

        // test/echo data
        stats = metrics.getResponseStatsPerPlan("Test", "echo", "1.0",
                parseDate("2015-06-01"), new DateTime().withZone(DateTimeZone.UTC));
        data = stats.getData();
        Assert.assertTrue(!data.isEmpty());
        point = data.get("Gold");
        Assert.assertNotNull(point);
        Assert.assertEquals(67L, point.getTotal());
        Assert.assertEquals(15L, point.getFailures());
        Assert.assertEquals(0L, point.getErrors());
    }
Test method for {@link EsMetricsAccessor#getResponseStatsPerPlan(String, String, String, DateTime, DateTime)
manager/test/api/src/test/java/io/apiman/manager/test/es/EsMetricsAccessorTest.java