Class DateAssert

All Implemented Interfaces:
Assert<DateAssert,Date>, Descriptable<DateAssert>, ExtensionPoints<DateAssert,Date>

public class DateAssert extends AbstractDateAssert<DateAssert>
Assertions for Dates.

To create a new instance of this class invoke Assertions.assertThat(Date).

Note that assertions with date parameter comes with two flavor, one is obviously a Date and the other is a String representing a Date.
For the latter, the default format follows ISO 8901 : "yyyy-MM-dd", user can override it with a custom format by calling AbstractDateAssert.withDateFormat(DateFormat).
The user custom format will then be used for all next Date assertions (i.e not limited to the current assertion) in the test suite.
To turn back to default format, simply call AbstractDateAssert.withDefaultDateFormatsOnly().
Author:
Tomasz Nurkiewicz (thanks for giving assertions idea), Joel Costigliola, Mikhail Mazursky
  • Constructor Details

    • DateAssert

      public DateAssert(Date actual)
      Creates a new DateAssert.
      Parameters:
      actual - the target to verify.