@Test public void testTimeIsUpdated() throws Exception { Measurement last = initialHistory.getLastMeasurement(); processor.process(exchange); MeasurementHistory newHistory = processor.getMeasurementHistory(exchange); assertNotSame(last, newHistory.getLastMeasurement()); }
@Test public void testUpdatedTimeIsAfterTheLastTime() throws Exception { Measurement initial = initialHistory.getLastMeasurement(); processor.process(exchange); MeasurementHistory history = processor.getMeasurementHistory(exchange); Measurement last = history.getLastMeasurement(); assertTrue(last.getTimestamp().getNanoValue() > initial.getTimestamp().getNanoValue()); }
@Test public void testReferenceDateIsNotChanged() throws Exception { Date referenceDate = initialHistory.getReferenceDate(); processor.process(exchange); processor.process(exchange); assertEquals(referenceDate, processor.getMeasurementHistory(exchange).getReferenceDate()); }