Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
  • Loading branch information
mherwege committed Nov 22, 2024
1 parent 5c76129 commit 30bf14b
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1494,17 +1494,18 @@ public void testRiemannSumSinceDecimalType() {
assertNotNull(sum);
DecimalType dt = sum.as(DecimalType.class);
assertNotNull(dt);
assertEquals(expected, dt.doubleValue(), HISTORIC_END * 1.0); // Allow max 1s difference between method and
// test

// Allow max 1 min difference between method and test, required as both expected and method tested retrieve
// now
assertEquals(expected, dt.doubleValue(), HISTORIC_END * 60.0);
start = ZonedDateTime.of(HISTORIC_INTERMEDIATE_VALUE_1, 1, 1, 0, 0, 0, 0, ZoneId.systemDefault());
expected = riemannSum(HISTORIC_INTERMEDIATE_VALUE_1, null, type);
sum = PersistenceExtensions.riemannSumSince(numberItem, start, type, SERVICE_ID);
assertNotNull(sum);
dt = sum.as(DecimalType.class);
assertNotNull(dt);
assertEquals(expected, dt.doubleValue(), HISTORIC_END * 1.0); // Allow max 1s difference between method and
// test value
// Allow max 1 min difference between method and test, required as both expected and method tested retrieve
// now
assertEquals(expected, dt.doubleValue(), HISTORIC_END * 60.0);

// default persistence service
sum = PersistenceExtensions.riemannSumSince(numberItem, start, type);
Expand All @@ -1521,8 +1522,9 @@ public void testRiemannSumUntilDecimalType() {
assertNotNull(sum);
DecimalType dt = sum.as(DecimalType.class);
assertNotNull(dt);
assertEquals(expected, dt.doubleValue(), HISTORIC_END * 1.0); // Allow max 1s difference between method and
// test value
// Allow max 1 min difference between method and test, required as both expected and method tested retrieve
// now
assertEquals(expected, dt.doubleValue(), HISTORIC_END * 60.0);
// default persistence service
sum = PersistenceExtensions.riemannSumUntil(numberItem, end, type);
assertNull(sum);
Expand Down

0 comments on commit 30bf14b

Please sign in to comment.