@Test
public void testGetHistoricalReadsHistoricalMetric() throws Exception {

	LocalDate localDate = LocalDate.now();
	AnalyticsReportsDataProvider analyticsReportsDataProvider =
		new AnalyticsReportsDataProvider(
			_getHttp(
				Collections.singletonMap(
					"/read-counts",
					JSONUtil.put(
						"histogram",
						JSONUtil.put(
							JSONUtil.put(
								"key",
								localDate.format(
									DateTimeFormatter.ISO_LOCAL_DATE)
							).put(
								"value", 5
							))
					).put(
						"value", 5
					).toJSONString())));
	HistoricalMetric historicalMetric =
		analyticsReportsDataProvider.getHistoricalReadsHistoricalMetric(
			RandomTestUtil.randomLong(),
			TimeRange.of(TimeSpan.LAST_7_DAYS, 0),
			RandomTestUtil.randomString());
	Assert.assertEquals(5.0, historicalMetric.getValue(), 0.0);
	List<HistogramMetric> histogramMetrics =
		historicalMetric.getHistogramMetrics();
	Assert.assertEquals(
		histogramMetrics.toString(), 1, histogramMetrics.size());
	HistogramMetric histogramMetric = histogramMetrics.get(0);
	Assert.assertEquals(5.0, histogramMetric.getValue(), 0.0);
	Date date = histogramMetric.getKey();
	Instant instant = date.toInstant();
	ZonedDateTime zonedDateTime = instant.atZone(ZoneId.systemDefault());
	Assert.assertEquals(localDate, zonedDateTime.toLocalDate());
}