tbel: refactoring tbUtils with docs #2

This commit is contained in:
nick 2024-09-03 14:22:29 +03:00
parent b86a9d3802
commit 03af2564eb
2 changed files with 2 additions and 2 deletions

View File

@ -1154,7 +1154,7 @@ public class TbUtils {
} }
public static void raiseError(String message, Object value) { 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); throw new RuntimeException(msg);
} }

View File

@ -891,7 +891,7 @@ public class TbUtilsTest {
TbUtils.raiseError(message, value); TbUtils.raiseError(message, value);
Assertions.fail("Should throw NumberFormatException"); Assertions.fail("Should throw NumberFormatException");
} catch (RuntimeException e) { } 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 { try {
TbUtils.raiseError(message); TbUtils.raiseError(message);