@Test
    public void testGetResponseStatsPerPlan() {
        Map<String, String> config = new HashMap<>();
        config.put("datasource.jndi-location", DB_JNDI_LOC);
        JdbcMetricsAccessor accessor = new JdbcMetricsAccessor(config);

        DateTime from = ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC).parseDateTime("2016-02-01T00:00:00Z");
        DateTime to = ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC).parseDateTime("2016-03-01T00:00:00Z");
        ResponseStatsPerPlanBean stats = accessor.getResponseStatsPerPlan("TestOrg", "TestApi", "1.0", from, to);
        ResponseStatsDataPoint dataPoint = stats.getData().get("Gold");
        Assert.assertNotNull(dataPoint);
        Assert.assertEquals(8, dataPoint.getTotal());
        Assert.assertEquals(1, dataPoint.getFailures());
        Assert.assertEquals(1, dataPoint.getErrors());

        dataPoint = stats.getData().get("Silver");
        Assert.assertNotNull(dataPoint);
        Assert.assertEquals(10, dataPoint.getTotal());
        Assert.assertEquals(2, dataPoint.getFailures());
        Assert.assertEquals(0, dataPoint.getErrors());
    }
Test for {@link JdbcMetricsAccessor#getResponseStatsPerPlan(String, String, String, DateTime, DateTime)}
manager/api/jdbc/src/test/java/io/apiman/manager/api/jdbc/JdbcMetricsAccessorTest.java