/** * Verifies that the actual {@code Date} is not in [start, end[ period * @param start the period start (inclusive), expected not to be null. * @param end the period end (exclusive), expected not to be null. * @return this assertion object. * @throws AssertionError if the actual {@code Date} 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 in [start, end[ period. * @throws AssertionError if one of the given date as String could not be converted to a Date. */ public DateAssert isNotBetween(Date start, Date end) { return isNotBetween(start, end, true, false); }
/** * Same assertion as {@link #isNotBetween(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 (inclusive), expected not to be null. * @param end the period end (exclusive), 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 isNotBetween(String start, String end, boolean inclusiveStart, boolean inclusiveEnd) { return isNotBetween(parse(start), parse(end), inclusiveStart, inclusiveEnd); }
/** * Same assertion as {@link #isNotBetween(Date, Date)} 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 (inclusive), expected not to be null. * @param end the period end (exclusive), expected not to be null. * @return this assertion object. * @throws AssertionError if the actual {@code Date} 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 in [start, end[ period. * @throws AssertionError if one of the given date as String could not be converted to a Date. */ public DateAssert isNotBetween(String start, String end) { return isNotBetween(parse(start), parse(end), true, false); }