Package org.assertj.core.api
Class DateAssert
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,Date>
-
- org.assertj.core.api.AbstractDateAssert<DateAssert>
-
- org.assertj.core.api.DateAssert
-
- All Implemented Interfaces:
Assert<DateAssert,Date>
,Descriptable<DateAssert>
,ExtensionPoints<DateAssert,Date>
public class DateAssert extends AbstractDateAssert<DateAssert>
Assertions forDate
s.To create a new instance of this class invoke
Note that assertions with date parameter comes with two flavor, one is obviously a
.Assertions.assertThat(Date)
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 callingAbstractDateAssert.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 callAbstractDateAssert.withDefaultDateFormatsOnly()
.- Author:
- Tomasz Nurkiewicz (thanks for giving assertions idea), Joel Costigliola, Mikhail Mazursky
-
-
Field Summary
-
Fields inherited from class org.assertj.core.api.AbstractDateAssert
dates, DEFAULT_DATE_FORMATS, userDateFormats
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, customRepresentation, info, myself, objects, printAssertionsDescription, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Constructor Description DateAssert(Date actual)
Creates a newDateAssert
.
-
Method Summary
-
Methods inherited from class org.assertj.core.api.AbstractDateAssert
hasDayOfMonth, hasDayOfWeek, hasHourOfDay, hasMillisecond, hasMinute, hasMonth, hasSameTimeAs, hasSameTimeAs, hasSecond, hasTime, hasYear, isAfter, isAfter, isAfter, isAfterOrEqualsTo, isAfterOrEqualsTo, isAfterOrEqualTo, isAfterOrEqualTo, isAfterOrEqualTo, isAfterYear, isBefore, isBefore, isBefore, isBeforeOrEqualsTo, isBeforeOrEqualsTo, isBeforeOrEqualTo, isBeforeOrEqualTo, isBeforeOrEqualTo, isBeforeYear, isBetween, isBetween, isBetween, isBetween, isBetween, isBetween, isCloseTo, isCloseTo, isCloseTo, isEqualTo, isEqualTo, isEqualToIgnoringHours, isEqualToIgnoringHours, isEqualToIgnoringHours, isEqualToIgnoringMillis, isEqualToIgnoringMillis, isEqualToIgnoringMillis, isEqualToIgnoringMinutes, isEqualToIgnoringMinutes, isEqualToIgnoringMinutes, isEqualToIgnoringSeconds, isEqualToIgnoringSeconds, isEqualToIgnoringSeconds, isIn, isIn, isInSameDayAs, isInSameDayAs, isInSameDayAs, isInSameHourAs, isInSameHourAs, isInSameHourWindowAs, isInSameHourWindowAs, isInSameHourWindowAs, isInSameMinuteAs, isInSameMinuteAs, isInSameMinuteWindowAs, isInSameMinuteWindowAs, isInSameMinuteWindowAs, isInSameMonthAs, isInSameMonthAs, isInSameMonthAs, isInSameSecondAs, isInSameSecondAs, isInSameSecondWindowAs, isInSameSecondWindowAs, isInSameSecondWindowAs, isInSameYearAs, isInSameYearAs, isInSameYearAs, isInTheFuture, isInThePast, isInWithStringDateCollection, isNotBetween, isNotBetween, isNotBetween, isNotBetween, isNotBetween, isNotBetween, isNotEqualTo, isNotEqualTo, isNotIn, isNotIn, isNotInWithStringDateCollection, isToday, isWithinDayOfMonth, isWithinDayOfWeek, isWithinHourOfDay, isWithinMillisecond, isWithinMinute, isWithinMonth, isWithinSecond, isWithinYear, parse, registerCustomDateFormat, registerCustomDateFormat, setLenientDateParsing, useDefaultDateFormatsOnly, usingComparator, usingComparator, usingDefaultComparator, withDateFormat, withDateFormat, withDefaultDateFormatsOnly
-
Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOfForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingRecursiveComparison, usingRecursiveComparison, withAssertionState, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs
-
-
-
-
Constructor Detail
-
DateAssert
public DateAssert(Date actual)
Creates a newDateAssert
.- Parameters:
actual
- the target to verify.
-
-