JexlStringFunctions implements ExpressionContextVisitor { public String urlEncode(String toEncode) { try { return URLEncoder.encode(toEncode, StandardCharsets.UTF_8.toString()); } catch (Exception e) { LOG.error("Error url encoding " + toEncode + ": " + e); } return toEncode; }  @Override void visit(JexlContext context); static void resetStatics(); String userIdFromDate(Object prefixLength, String dateFormat); String userIdDate(Object oprefixLength, String dateFormat); String userIdFromRange(Object ominId, Object omaxId); String concat(String... values); String substring(String subject, int start); String substringBetween(String subject, String open, String close); String substringBetween(String subject, String open, String close, int index); String replaceBetween(String subject, String open, String close, String replace, boolean encodeData); static void main(String[] args); String substring(String subject, int start, int stop); String randomAlphaLower(int length); String randomAlphaUpper(int length); String randomAlphaMixed(int length); String randomNumeric(int length); String randomSpecial(int length); String randomAlphaMixedNumeric(int length); String randomAlphaMixedSpecial(int length); String randomAlphaMixedNumericSpecial(int length); String toBase64(String toEncode); String fromBase64(String toDecode); String byteArrayToBase64(byte[] bytes); String urlEncode(String toEncode); String urlDecode(String toDecode); String getUUID();  }
@Test @Tag(TestGroups.FUNCTIONAL) public void testUrlEncode() { String evaluated = variables.evaluate("#{stringFunctions.urlEncode('&hello')}"); assertNotNull(evaluated); String decoded = variables.evaluate("#{stringFunctions.urlDecode('" + evaluated + "')}"); assertEquals(decoded, "&hello"); }