JexlTaxFunctions implements ExpressionContextVisitor { public String getSsn(Object ostartSsn) { long startSsn = FunctionHandler.getLong(ostartSsn); String ssnString = ""; synchronized (lockSSN) { do { if (lastSSN < 0) lastSSN = startSsn; else lastSSN++; } while (!isValidSsn(lastSSN)); ssnString = "" + lastSSN; for (int z = 0; z <= (9 - ssnString.length()); z++) { ssnString = "0" + ssnString; } } ssnString = ssnString.substring(0, 3) + "-" + ssnString.substring(3, 5) + "-" + ssnString.substring(5, 9); return ssnString; }  String getSsn(Object ostartSsn); @Override void visit(JexlContext context);  }
@Test @Tag(TestGroups.FUNCTIONAL) public void testGetSSN() { String random = variables.evaluate("#{taxFunctions.getSsn(1)}"); assertNotNull(random); assertTrue(random.length() == 11); }