}
public void getLatestDataPoint() {
NonVersionedRedisHistoricalTimeSeriesSource htsSource = new NonVersionedRedisHistoricalTimeSeriesSource(getJedisPool(), getRedisPrefix());
UniqueId id = UniqueId.of("Test", "1");
HistoricalTimeSeries hts = htsSource.getHistoricalTimeSeries(id);
assertNull(hts);
LocalDateDoubleTimeSeriesBuilder tsBuilder = ImmutableLocalDateDoubleTimeSeries.builder();
tsBuilder.put(LocalDate.parse("2013-06-04"), 14.0);
tsBuilder.put(LocalDate.parse("2013-06-05"), 15.0);
tsBuilder.put(LocalDate.parse("2013-06-06"), 16.0);
tsBuilder.put(LocalDate.parse("2013-06-07"), 17.0);
tsBuilder.put(LocalDate.parse("2013-06-08"), 18.0);
tsBuilder.put(LocalDate.parse("2013-06-09"), 24.0);
tsBuilder.put(LocalDate.parse("2013-06-10"), 25.0);
tsBuilder.put(LocalDate.parse("2013-06-11"), 26.0);
tsBuilder.put(LocalDate.parse("2013-06-12"), 27.0);
tsBuilder.put(LocalDate.parse("2013-06-13"), 28.0);
tsBuilder.put(LocalDate.parse("2013-06-14"), 34.0);
tsBuilder.put(LocalDate.parse("2013-06-15"), 35.0);
tsBuilder.put(LocalDate.parse("2013-06-16"), 36.0);
tsBuilder.put(LocalDate.parse("2013-06-17"), 37.0);
tsBuilder.put(LocalDate.parse("2013-06-18"), 38.0);
htsSource.updateTimeSeries(id, tsBuilder.build());
hts = htsSource.getHistoricalTimeSeries(id);
assertNotNull(hts);
assertEquals(id, hts.getUniqueId());
LocalDateDoubleTimeSeries ts = hts.getTimeSeries();
assertEquals(15, ts.size());
assertEquals(14.0, ts.getValue(LocalDate.parse("2013-06-04")), 0.00001);
assertEquals(15.0, ts.getValue(LocalDate.parse("2013-06-05")), 0.00001);
assertEquals(16.0, ts.getValue(LocalDate.parse("2013-06-06")), 0.00001);
assertEquals(17.0, ts.getValue(LocalDate.parse("2013-06-07")), 0.00001);