fixed test where rolling arg is NaN

This commit is contained in:
IrynaMatveieva 2025-02-19 09:06:23 +02:00
parent 6f22bbface
commit 300650ceb6
2 changed files with 3 additions and 4 deletions

View File

@ -151,7 +151,7 @@ public class ScriptCalculatedFieldStateTest {
}
private TsRollingArgumentEntry createRollingArgEntry() {
TsRollingArgumentEntry argumentEntry = new TsRollingArgumentEntry();
TsRollingArgumentEntry argumentEntry = new TsRollingArgumentEntry(5, 30000L);
long ts = System.currentTimeMillis();
TreeMap<Long, Double> values = new TreeMap<>();

View File

@ -79,9 +79,8 @@ public class TsRollingArgumentEntryTest {
void testUpdateEntryWhenValueIsNotNumber() {
SingleValueArgumentEntry newEntry = new SingleValueArgumentEntry(ts - 10, new StringDataEntry("key", "string"), 123L);
assertThatThrownBy(() -> entry.updateEntry(newEntry))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Time series rolling arguments supports only numeric values.");
assertThat(entry.updateEntry(newEntry)).isTrue();
assertThat(entry.getTsRecords().get(ts - 10)).isNaN();
}
@Test