/** * Same assertion as {@link #isBetween(Date, Date, boolean, boolean)} but given Dates are * represented as String either with ISO date format (yyyy-MM-dd) or user custom date format (set * with method {@link #withDateFormat(DateFormat)}). * * @param start the period start, expected not to be null. * @param end the period end, expected not to be null. * @param inclusiveStart wether to include start date in period. * @param inclusiveEnd wether to include end date in period. * @return this assertion object. * @throws AssertionError if {@code actual} is {@code null}. * @throws NullPointerException if start Date as String is {@code null}. * @throws NullPointerException if end Date as String is {@code null}. * @throws AssertionError if the actual {@code Date} is not in (start, end) period. * @throws AssertionError if one of the given date as String could not be converted to a Date. */ public DateAssert isBetween( String start, String end, boolean inclusiveStart, boolean inclusiveEnd) { dates.assertIsBetween(info, actual, parse(start), parse(end), inclusiveStart, inclusiveEnd); return this; }
/** * Verifies that the actual {@code Date} is in the given period defined by start and end dates. * <br> * To include start in the period set inclusiveStart parameter to <code>true</code>.<br> * To include end in the period set inclusiveEnd parameter to <code>true</code>.<br> * * @param start the period start, expected not to be null. * @param end the period end, expected not to be null. * @param inclusiveStart wether to include start date in period. * @param inclusiveEnd wether to include end date in period. * @return this assertion object. * @throws AssertionError if {@code actual} is {@code null}. * @throws NullPointerException if start {@code Date} is {@code null}. * @throws NullPointerException if end {@code Date} is {@code null}. * @throws AssertionError if the actual {@code Date} is not in (start, end) period. */ public DateAssert isBetween(Date start, Date end, boolean inclusiveStart, boolean inclusiveEnd) { dates.assertIsBetween(info, actual, start, end, inclusiveStart, inclusiveEnd); return this; }