@Test
    public void testGetResponseStats() {
        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-01-01T00:00:00Z");
        DateTime to = ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC).parseDateTime("2016-12-31T00:00:00Z");
        ResponseStatsHistogramBean stats = accessor.getResponseStats("TestOrg", "TestApi", "1.0", HistogramIntervalType.month, from, to);
        Assert.assertNotNull(stats);
        for (ResponseStatsDataPoint dataPoint : stats.getData()) {
            if (dataPoint.getLabel().equals("2016-02-01T00:00:00.000Z")) {
                Assert.assertEquals(18, dataPoint.getTotal());
                Assert.assertEquals(1, dataPoint.getErrors());
                Assert.assertEquals(3, dataPoint.getFailures());
            } else {
                Assert.assertEquals(0, dataPoint.getTotal());
                Assert.assertEquals(0, dataPoint.getErrors());
                Assert.assertEquals(0, dataPoint.getFailures());
            }
        }
        
        from = ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC).parseDateTime("2016-02-01T00:00:00Z");
        to = ISODateTimeFormat.dateTimeNoMillis().withZone(DateTimeZone.UTC).parseDateTime("2016-03-01T00:00:00Z");
        stats = accessor.getResponseStats("TestOrg", "TestApi", "1.0", HistogramIntervalType.day, from, to);
        Assert.assertNotNull(stats);
        ResponseStatsDataPoint dataPoint = stats.getData().get(9);
        Assert.assertEquals(2, dataPoint.getTotal());
        Assert.assertEquals(0, dataPoint.getErrors());
        Assert.assertEquals(0, dataPoint.getFailures());
        dataPoint = stats.getData().get(10);
        Assert.assertEquals(1, dataPoint.getTotal());
        Assert.assertEquals(0, dataPoint.getErrors());
        Assert.assertEquals(0, dataPoint.getFailures());
        dataPoint = stats.getData().get(22);
        Assert.assertEquals(9, dataPoint.getTotal());
        Assert.assertEquals(1, dataPoint.getErrors());
        Assert.assertEquals(1, dataPoint.getFailures());
        dataPoint = stats.getData().get(23);
        Assert.assertEquals(6, dataPoint.getTotal());
        Assert.assertEquals(0, dataPoint.getErrors());
        Assert.assertEquals(2, dataPoint.getFailures());

        dataPoint = stats.getData().get(5);
        Assert.assertEquals(0, dataPoint.getTotal());
        Assert.assertEquals(0, dataPoint.getErrors());
        Assert.assertEquals(0, dataPoint.getFailures());
        dataPoint = stats.getData().get(19);
        Assert.assertEquals(0, dataPoint.getTotal());
        Assert.assertEquals(0, dataPoint.getErrors());
        Assert.assertEquals(0, dataPoint.getFailures());
    }
Test method for {@link io.apiman.manager.api.jdbc.JdbcMetricsAccessor#getResponseStats(String, String, String, HistogramIntervalType, DateTime, DateTime)}.
manager/api/jdbc/src/test/java/io/apiman/manager/api/jdbc/JdbcMetricsAccessorTest.java