Class DateRangeValidationMatcher

  • All Implemented Interfaces:
    com.consol.citrus.validation.matcher.ValidationMatcher

    public class DateRangeValidationMatcher
    extends Object
    implements com.consol.citrus.validation.matcher.ValidationMatcher
    Validation matcher for verifying a date is within the specified range. The following check is made when performing the validation:
    from-date >= date-to-validate <= to-date
    Since:
    2.5
    Author:
    Martin Maher
    • Constructor Detail

      • DateRangeValidationMatcher

        public DateRangeValidationMatcher()
    • Method Detail

      • validate

        public void validate​(String fieldName,
                             String value,
                             List<String> params,
                             com.consol.citrus.context.TestContext context)
                      throws com.consol.citrus.exceptions.ValidationException
        Specified by:
        validate in interface com.consol.citrus.validation.matcher.ValidationMatcher
        Throws:
        com.consol.citrus.exceptions.ValidationException
      • toCalender

        protected Calendar toCalender​(String date,
                                      String datePattern)
        Converts the supplied date to it's calendar representation. The datePattern is used for parsing the date.
        Parameters:
        date - the date to parse
        datePattern - the date format to use when parsing the date
        Returns:
        the calendar representation