public abstract class AbstractLocalDateAssert<S extends AbstractLocalDateAssert<S>> extends AbstractAssert<S,LocalDate>
LocalDate type from new Date & Time API introduced in Java 8.| Modifier and Type | Field and Description |
|---|---|
static String |
NULL_LOCAL_DATE_TIME_PARAMETER_MESSAGE |
actual, info, myself| Modifier | Constructor and Description |
|---|---|
protected |
AbstractLocalDateAssert(LocalDate actual,
Class<?> selfType)
Creates a new
. |
| Modifier and Type | Method and Description |
|---|---|
protected LocalDate |
getActual() |
S |
isAfter(LocalDate other)
Verifies that the actual
LocalDate is strictly after the given one. |
S |
isAfter(String localDateTimeAsString)
Same assertion as
isAfter(LocalDate) but the LocalDate is built from given a String that
must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isAfterOrEqualTo(LocalDate other)
Verifies that the actual
LocalDate is after or equals to the given one. |
S |
isAfterOrEqualTo(String localDateTimeAsString)
Same assertion as
isAfterOrEqualTo(LocalDate) but the LocalDate is built from given
String, which must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isBefore(LocalDate other)
Verifies that the actual
LocalDate is strictly before the given one. |
S |
isBefore(String localDateTimeAsString)
Same assertion as
isBefore(LocalDate) but the LocalDate is built from given String, which
must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isBeforeOrEqualTo(LocalDate other)
Verifies that the actual
LocalDate is before or equals to the given one. |
S |
isBeforeOrEqualTo(String localDateTimeAsString)
Same assertion as
isBeforeOrEqualTo(LocalDate) but the LocalDate is built from given
String, which must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isEqualTo(String dateTimeAsString)
Same assertion as
AbstractAssert.isEqualTo(Object) (where Object is expected to be LocalDate) but here you
pass LocalDate String representation that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isIn(String... dateTimesAsString)
Same assertion as
AbstractAssert.isIn(Object...) (where Objects are expected to be LocalDate) but here you
pass LocalDate String representations that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isNotEqualTo(String dateTimeAsString)
Same assertion as
AbstractAssert.isNotEqualTo(Object) (where Object is expected to be LocalDate) but here you
pass LocalDate String representation that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isNotIn(String... dateTimesAsString)
Same assertion as
AbstractAssert.isNotIn(Object...) (where Objects are expected to be LocalDate) but here you
pass LocalDate String representations that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method. |
S |
isToday()
Verifies that the actual
LocalDate is today, that is matching current year, month and day. |
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnErrorpublic static final String NULL_LOCAL_DATE_TIME_PARAMETER_MESSAGE
protected AbstractLocalDateAssert(LocalDate actual, Class<?> selfType)
AbstractLocalDateAssert.selfType - the "self type"actual - the actual value to verifyprotected LocalDate getActual()
public S isBefore(LocalDate other)
LocalDate is strictly before the given one.
Example :
assertThat(parse("2000-01-01")).isBefore(parse("2000-01-02"));other - the given LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if other LocalDate is null.AssertionError - if the actual LocalDate is not strictly before the given one.public S isBefore(String localDateTimeAsString)
isBefore(LocalDate) but the LocalDate is built from given String, which
must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use directly String in comparison to avoid writing the code to perform the conversion
assertThat(parse("2000-01-01")).isBefore("2000-01-02");localDateTimeAsString - String representing a LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is not strictly before the LocalDate built
from given String.public S isBeforeOrEqualTo(LocalDate other)
LocalDate is before or equals to the given one.
Example :
assertThat(parse("2000-01-01")).isBeforeOrEqualTo(parse("2000-01-01"))
.isBeforeOrEqualTo(parse("2000-01-02"));other - the given LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if other LocalDate is null.AssertionError - if the actual LocalDate is not before or equals to the given one.public S isBeforeOrEqualTo(String localDateTimeAsString)
isBeforeOrEqualTo(LocalDate) but the LocalDate is built from given
String, which must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use String in comparison to avoid conversion
assertThat(parse("2000-01-01")).isBeforeOrEqualTo("2000-01-01")
.isBeforeOrEqualTo("2000-01-02");localDateTimeAsString - String representing a LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is not before or equals to the LocalDate built from
given String.public S isAfterOrEqualTo(LocalDate other)
LocalDate is after or equals to the given one.
Example :
assertThat(parse("2000-01-01")).isAfterOrEqualTo(parse("2000-01-01"))
.isAfterOrEqualTo(parse("1999-12-31"));other - the given LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if other LocalDate is null.AssertionError - if the actual LocalDate is not after or equals to the given one.public S isAfterOrEqualTo(String localDateTimeAsString)
isAfterOrEqualTo(LocalDate) but the LocalDate is built from given
String, which must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use String in comparison to avoid conversion
assertThat(parse("2000-01-01")).isAfterOrEqualTo("2000-01-01")
.isAfterOrEqualTo("1999-12-31");localDateTimeAsString - String representing a LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is not after or equals to the LocalDate built from
given String.public S isAfter(LocalDate other)
LocalDate is strictly after the given one.
Example :
assertThat(parse("2000-01-01")).isAfter(parse("1999-12-31"));other - the given LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if other LocalDate is null.AssertionError - if the actual LocalDate is not strictly after the given one.public S isAfter(String localDateTimeAsString)
isAfter(LocalDate) but the LocalDate is built from given a String that
must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use String in comparison to avoid conversion
assertThat(parse("2000-01-01")).isAfter("1999-12-31");localDateTimeAsString - String representing a LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is not strictly after the LocalDate built
from given String.public S isEqualTo(String dateTimeAsString)
AbstractAssert.isEqualTo(Object) (where Object is expected to be LocalDate) but here you
pass LocalDate String representation that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use directly String in comparison to avoid writing the code to perform the conversion
assertThat(parse("2000-01-01")).isEqualTo("2000-01-01");dateTimeAsString - String representing a LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is not equal to the LocalDate built from
given String.public S isNotEqualTo(String dateTimeAsString)
AbstractAssert.isNotEqualTo(Object) (where Object is expected to be LocalDate) but here you
pass LocalDate String representation that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use directly String in comparison to avoid writing the code to perform the conversion
assertThat(parse("2000-01-01")).isNotEqualTo("2000-01-15");dateTimeAsString - String representing a LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is equal to the LocalDate built from given
String.public S isIn(String... dateTimesAsString)
AbstractAssert.isIn(Object...) (where Objects are expected to be LocalDate) but here you
pass LocalDate String representations that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use String based representation of LocalDate
assertThat(parse("2000-01-01")).isIn("1999-12-31", "2000-01-01");dateTimesAsString - String array representing LocalDates.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is not in the LocalDates built from given
Strings.public S isNotIn(String... dateTimesAsString)
AbstractAssert.isNotIn(Object...) (where Objects are expected to be LocalDate) but here you
pass LocalDate String representations that must follow ISO LocalDate format to allow calling LocalDate.parse(CharSequence) method.
Example :
// use String based representation of LocalDate
assertThat(parse("2000-01-01")).isNotIn("1999-12-31", "2000-01-02");dateTimesAsString - Array of String representing a LocalDate.AssertionError - if the actual LocalDate is null.IllegalArgumentException - if given String is null or can't be converted to a LocalDate.AssertionError - if the actual LocalDate is in the LocalDates built from given
Strings.public S isToday()
LocalDate is today, that is matching current year, month and day.
Example:
// assertion will pass
assertThat(LocalDate.now()).isToday();
// assertion will fail
assertThat(theFellowshipOfTheRing.getReleaseDate()).isToday();AssertionError - if the actual LocalDate is null.AssertionError - if the actual LocalDate is not today.Copyright © 2014–2016 AssertJ. All rights reserved.