Browse Source

tbel: refactoring tbUtils with docs #2

pull/11551/head
nick 2 years ago
parent
commit
03af2564eb
  1. 2
      common/script/script-api/src/main/java/org/thingsboard/script/api/tbel/TbUtils.java
  2. 2
      common/script/script-api/src/test/java/org/thingsboard/script/api/tbel/TbUtilsTest.java

2
common/script/script-api/src/main/java/org/thingsboard/script/api/tbel/TbUtils.java

@ -1154,7 +1154,7 @@ public class TbUtils {
}
public static void raiseError(String message, Object value) {
String msg = value == null ? message : message + " for value " + value;
String msg = value == null ? message : message + " A value of " + value + " is invalid.";
throw new RuntimeException(msg);
}

2
common/script/script-api/src/test/java/org/thingsboard/script/api/tbel/TbUtilsTest.java

@ -891,7 +891,7 @@ public class TbUtilsTest {
TbUtils.raiseError(message, value);
Assertions.fail("Should throw NumberFormatException");
} catch (RuntimeException e) {
Assertions.assertTrue(e.getMessage().contains("frequency_weighting_type must be 0, 1 or 2. for value 4"));
Assertions.assertTrue(e.getMessage().contains("frequency_weighting_type must be 0, 1 or 2. A value of 4 is invalid."));
}
try {
TbUtils.raiseError(message);

Loading…
Cancel
Save