JexlNumericFunctions implements ExpressionContextVisitor { public String randomPositiveWhole(Object olength) { int length = FunctionHandler.getInt(olength); if (length == 0) { return ""; } StringBuilder output = new StringBuilder(length); output.append(rnd.nextInt(8) + 1); for (int i = 0; i < length - 1; i++) { output.append(rnd.nextInt(9)); } return output.toString(); }  @Override void visit(JexlContext context); String mod(Object num, Object mod); String add(Object... values); String subtract(Object... values); String random(Object omin, Object omax); String random(Object omax); String randomPositiveWhole(Object olength); String randomNegativeWhole(Object olength); String randomPositiveFloat(Object owhole, Object odecimal); String randomNegativeFloat(Object owhole, Object odecimal); String toInt(String num);  }
@Test @Tag(TestGroups.FUNCTIONAL) public void testRandomPositiveWhole() { String random = variables.evaluate("#{numericFunctions.randomPositiveWhole(4)}"); assertNotNull(random); assertTrue(random.length() == 4); random = variables.evaluate("#{numericFunctions.randomPositiveWhole(two_int)}"); assertNotNull(random); assertTrue(random.length() == 2); }