diff --git a/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/ScriptCalculatedFieldStateTest.java b/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/ScriptCalculatedFieldStateTest.java index bc75bd74ff..e52e6e985a 100644 --- a/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/ScriptCalculatedFieldStateTest.java +++ b/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/ScriptCalculatedFieldStateTest.java @@ -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 values = new TreeMap<>(); diff --git a/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/TsRollingArgumentEntryTest.java b/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/TsRollingArgumentEntryTest.java index 75aca61825..8f8abadf02 100644 --- a/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/TsRollingArgumentEntryTest.java +++ b/application/src/test/java/org/thingsboard/server/service/cf/ctx/state/TsRollingArgumentEntryTest.java @@ -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