DateRangeValidationMatcher implements ValidationMatcher { protected Calendar toCalender(String date, String datePattern) { SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern); Calendar cal = Calendar.getInstance(); try { cal.setTime(dateFormat.parse(date)); } catch (ParseException e) { throw new CitrusRuntimeException(String.format("Error parsing date '%s' using pattern '%s'", date, datePattern), e); } return cal; }  @Override void validate(String fieldName, String value, List<String> params, TestContext context);  }
@Test(dataProvider = "validDates") public void shouldSucceedParsingDate(String date, String dateFormat) { testling.toCalender(date, dateFormat); }