Top Description Fields Constructors Methods
org.assertj.core.api

public abstract Class AbstractLocalDateAssert<SELF extends AbstractLocalDateAssert<SELF>>

extends AbstractTemporalAssert<SELF extends AbstractLocalDateAssert<SELF>, LocalDate>
Class Inheritance
Known Direct Subclasses
org.assertj.core.api.LocalDateAssert
Type Parameters
<SELF>
the "self" type of this assertion class.
Static Imports
org.assertj.core.error.ShouldBeAfter.shouldBeAfter, .ShouldBeAfterOrEqualTo.shouldBeAfterOrEqualTo, .ShouldBeBefore.shouldBeBefore, .ShouldBeBeforeOrEqualTo.shouldBeBeforeOrEqualTo, .ShouldBeInTheFuture.shouldBeInTheFuture, .ShouldBeInThePast.shouldBeInThePast, .ShouldBeToday.shouldBeToday, .ShouldHaveDateField.shouldHaveDateField, .ShouldHaveDateField.shouldHaveMonth, org.assertj.core.util.Preconditions.checkArgument

Assertions for LocalDate type from new Date & Time API introduced in Java 8.

Field Summary

Modifier and TypeField and Description
public static final String
Inherited from org.assertj.core.api.AbstractTemporalAssert:
comparables

Constructor Summary

AccessConstructor and Description
protected
AbstractLocalDateAssert(LocalDate
the actual value to verify
actual
,
Class<?>
the "self type"
selfType
)

Creates a new org.assertj.core.api.AbstractLocalDateAssert.

Method Summary

Modifier and TypeMethod and Description
private static void
assertLocalDateAsStringParameterIsNotNull(String
String representing the LocalDate to compare actual with
localDateAsString
)

Check that the LocalDate string representation to compare actual LocalDate to is not null, otherwise throws a IllegalArgumentException with an explicit message

private static void
assertLocalDateParameterIsNotNull(LocalDate
the LocalDate to check
other
)

Check that the LocalDate to compare actual LocalDate to is not null, in that case throws a IllegalArgumentException with an explicit message

private void
private static Object[]
convertToLocalDateArray(String... localDatesAsString)

public SELF

Returns:

this assertion object.
hasDayOfMonth
(int
the given numeric day.
day
)

Verifies that actual LocalDate is on the given day.

public SELF

Returns:

this assertion object.
hasMonth
(Month
the given Month.
month
)

Verifies that actual LocalDate is in the given month.

public SELF

Returns:

this assertion object.
hasMonthValue
(int
the given month's value between 1 and 12 inclusive.
month
)

Verifies that actual LocalDate is in the given month.

public SELF

Returns:

this assertion object.
hasYear
(int
the given year.
year
)

Verifies that actual LocalDate is in the given year.

public SELF

Returns:

this assertion object.
isAfter
(LocalDate
the given LocalDate.
other
)

Verifies that the actual LocalDate is strictly after the given one.

public SELF

Returns:

this assertion object.
isAfter
(String
String representing a LocalDate.
localDateAsString
)

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.

public SELF

Returns:

this assertion object.
isAfterOrEqualTo
(LocalDate
the given LocalDate.
other
)

Verifies that the actual LocalDate is after or equals to the given one.

public SELF

Returns:

this assertion object.
isAfterOrEqualTo
(String
String representing a LocalDate.
localDateAsString
)

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.

public SELF

Returns:

this assertion object.
isBefore
(LocalDate
the given LocalDate.
other
)

Verifies that the actual LocalDate is strictly before the given one.

public SELF

Returns:

this assertion object.
isBefore
(String
String representing a LocalDate.
localDateAsString
)

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.

public SELF

Returns:

this assertion object.
isBeforeOrEqualTo
(LocalDate
the given LocalDate.
other
)

Verifies that the actual LocalDate is before or equals to the given one.

public SELF

Returns:

this assertion object.
isBeforeOrEqualTo
(String
String representing a LocalDate.
localDateAsString
)

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.

public SELF

Returns:

this assertion object.
isBetween
(LocalDate
the start value (inclusive), expected not to be null.
startInclusive
,
LocalDate
the end value (inclusive), expected not to be null.
endInclusive
)

Verifies that the actual LocalDate is in the [start, end] period (start and end included).

public SELF

Returns:

this assertion object.
isBetween
(String
the start value (inclusive), expected not to be null.
startInclusive
,
String
the end value (inclusive), expected not to be null.
endInclusive
)

Same assertion as isBetween(LocalDate, LocalDate) but here you pass LocalDate String representations which must follow ISO LocalDate format to allow calling LocalDate#parse(CharSequence) method.

public SELF

Returns:

this assertion object.
isEqualTo
(String
String representing a LocalDate.
localDateAsString
)

Same assertion as 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.

public SELF

Returns:

this assertion object.
isIn
(String...
String array representing LocalDates.
localDatesAsString
)

Same assertion as 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.

public SELF

Returns:

this assertion object.
isInTheFuture
()

Verifies that the actual LocalDate is strictly in the future.

public SELF

Returns:

this assertion object.
isInThePast
()

Verifies that the actual LocalDate is strictly in the past.

public SELF

Returns:

this assertion object.
isNotEqualTo
(String
String representing a LocalDate.
localDateAsString
)

Same assertion as 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.

public SELF

Returns:

this assertion object.
isNotIn
(String...
Array of String representing a LocalDate.
localDatesAsString
)

Same assertion as 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.

public SELF

Returns:

this assertion object.
isStrictlyBetween
(LocalDate
the start value (exclusive), expected not to be null.
startExclusive
,
LocalDate
the end value (exclusive), expected not to be null.
endExclusive
)

Verifies that the actual LocalDate is in the ]start, end[ period (start and end excluded).

public SELF

Returns:

this assertion object.
isStrictlyBetween
(String
the start value (exclusive), expected not to be null.
startExclusive
,
String
the end value (exclusive), expected not to be null.
endExclusive
)

Same assertion as isStrictlyBetween(LocalDate, LocalDate) but here you pass LocalDate String representations which must follow ISO LocalDate format to allow calling LocalDate#parse(CharSequence) method.

public SELF

Returns:

this assertion object.
isToday
()

Verifies that the actual LocalDate is today, that is matching current year, month and day.

protected LocalDate
parse(String
the string to parse, not null
localDateAsString
)

Implements abstract org.assertj.core.api.AbstractTemporalAssert.parse.

Obtains an instance of TEMPORAL from a string representation in ISO date format.
Inherited from org.assertj.core.api.AbstractTemporalAssert:
getActualisCloseToisCloseTousingComparatorusingComparatorusingDefaultComparator

Field Detail

NULL_LOCAL_DATE_TIME_PARAMETER_MESSAGEback to summary
public static final String NULL_LOCAL_DATE_TIME_PARAMETER_MESSAGE

Constructor Detail

AbstractLocalDateAssertback to summary
protected AbstractLocalDateAssert(LocalDate actual, Class<?> selfType)

Creates a new org.assertj.core.api.AbstractLocalDateAssert.

Parameters
actual:LocalDate

the actual value to verify

selfType:Class<?>

the "self type"

Method Detail

assertLocalDateAsStringParameterIsNotNullback to summary
private static void assertLocalDateAsStringParameterIsNotNull(String localDateAsString)

Check that the LocalDate string representation to compare actual LocalDate to is not null, otherwise throws a IllegalArgumentException with an explicit message

Parameters
localDateAsString:String

String representing the LocalDate to compare actual with

Exceptions
IllegalArgumentException:
with an explicit message if the given String is null
assertLocalDateParameterIsNotNullback to summary
private static void assertLocalDateParameterIsNotNull(LocalDate other)

Check that the LocalDate to compare actual LocalDate to is not null, in that case throws a IllegalArgumentException with an explicit message

Parameters
other:LocalDate

the LocalDate to check

Exceptions
IllegalArgumentException:
with an explicit message if the given LocalDate is null
checkIsNotNullAndNotEmptyback to summary
private void checkIsNotNullAndNotEmpty(Object[] values)
convertToLocalDateArrayback to summary
private static Object[] convertToLocalDateArray(String... localDatesAsString)
hasDayOfMonthback to summary
public SELF hasDayOfMonth(int day)

Verifies that actual LocalDate is on the given day.

Example:

 // Assertion succeeds:
assertThat(LocalDate.of(2000, 12, 31)).hasDayOfMonth(31);

// Assertion fails:
assertThat(LocalDate.of(2000, 12, 31)).hasDayOfMonth(1);
Parameters
day:int

the given numeric day.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not on the given day.
Since
3.23.0
hasMonthback to summary
public SELF hasMonth(Month month)

Verifies that actual LocalDate is in the given month.

Example:

 // Assertion succeeds:
assertThat(LocalDate.of(2000, 12, 31)).hasMonth(Month.DECEMBER);

// Assertion fails:
assertThat(LocalDate.of(2000, 12, 31)).hasMonth(Month.JANUARY);
Parameters
month:Month

the given Month.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not in the given month.
Since
3.23.0
hasMonthValueback to summary
public SELF hasMonthValue(int month)

Verifies that actual LocalDate is in the given month.

Example:

 // Assertion succeeds:
assertThat(LocalDate.of(2000, 12, 31)).hasMonthValue(12);

// Assertion fails:
assertThat(LocalDate.of(2000, 12, 31)).hasMonthValue(11);
Parameters
month:int

the given month's value between 1 and 12 inclusive.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not in the given month.
Since
3.23.0
hasYearback to summary
public SELF hasYear(int year)

Verifies that actual LocalDate is in the given year.

Example:

 // Assertion succeeds:
assertThat(LocalDate.of(2000, 12, 31)).hasYear(2000);

// Assertion fails:
assertThat(LocalDate.of(2000, 12, 31)).hasYear(2001);
Parameters
year:int

the given year.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not in the given year.
Since
3.23.0
isAfterback to summary
public SELF isAfter(LocalDate other)

Verifies that the actual LocalDate is strictly after the given one.

Example :

 assertThat(parse("2000-01-01")).isAfter(parse("1999-12-31"));
Parameters
other:LocalDate

the given LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not strictly after the given one.
IllegalArgumentException:
if other LocalDate is null.
isAfterback to summary
public SELF isAfter(String localDateAsString)

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.

Example :

 // use String in comparison to avoid conversion
assertThat(parse("2000-01-01")).isAfter("1999-12-31");
Parameters
localDateAsString:String

String representing a LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not strictly after the LocalDate built from given String.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isAfterOrEqualToback to summary
public SELF isAfterOrEqualTo(LocalDate other)

Verifies that the actual 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"));
Parameters
other:LocalDate

the given LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not after or equals to the given one.
IllegalArgumentException:
if other LocalDate is null.
isAfterOrEqualToback to summary
public SELF isAfterOrEqualTo(String localDateAsString)

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.

Example :

 // use String in comparison to avoid conversion
assertThat(parse("2000-01-01")).isAfterOrEqualTo("2000-01-01")
                               .isAfterOrEqualTo("1999-12-31");
Parameters
localDateAsString:String

String representing a LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not after or equals to the LocalDate built from given String.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isBeforeback to summary
public SELF isBefore(LocalDate other)

Verifies that the actual LocalDate is strictly before the given one.

Example :

 assertThat(parse("2000-01-01")).isBefore(parse("2000-01-02"));
Parameters
other:LocalDate

the given LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not strictly before the given one.
IllegalArgumentException:
if other LocalDate is null.
isBeforeback to summary
public SELF isBefore(String localDateAsString)

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.

Example :

 // use String in comparison to avoid writing the code to perform the conversion
assertThat(parse("2000-01-01")).isBefore("2000-01-02");
Parameters
localDateAsString:String

String representing a LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not strictly before the LocalDate built from given String.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isBeforeOrEqualToback to summary
public SELF isBeforeOrEqualTo(LocalDate other)

Verifies that the actual 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"));
Parameters
other:LocalDate

the given LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not before or equals to the given one.
IllegalArgumentException:
if other LocalDate is null.
isBeforeOrEqualToback to summary
public SELF isBeforeOrEqualTo(String localDateAsString)

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.

Example :

 // use String in comparison to avoid conversion
assertThat(parse("2000-01-01")).isBeforeOrEqualTo("2000-01-01")
                               .isBeforeOrEqualTo("2000-01-02");
Parameters
localDateAsString:String

String representing a LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not before or equals to the LocalDate built from given String.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isBetweenback to summary
public SELF isBetween(LocalDate startInclusive, LocalDate endInclusive)

Verifies that the actual LocalDate is in the [start, end] period (start and end included).

Example:

 LocalDate localDate = LocalDate.now();

// assertions succeed:
assertThat(localDate).isBetween(localDate.minusDays(1), localDate.plusDays(1))
                     .isBetween(localDate, localDate.plusDays(1))
                     .isBetween(localDate.minusDays(1), localDate)
                     .isBetween(localDate, localDate);

// assertions fail:
assertThat(localDate).isBetween(localDate.minusDays(10), localDate.minusDays(1));
assertThat(localDate).isBetween(localDate.plusDays(1), localDate.plusDays(10));
Parameters
startInclusive:LocalDate

the start value (inclusive), expected not to be null.

endInclusive:LocalDate

the end value (inclusive), expected not to be null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in [start, end] period.
NullPointerException:
  • if start value is null.
  • if end value is null.
Since
3.7.1
isBetweenback to summary
public SELF isBetween(String startInclusive, String endInclusive)

Same assertion as isBetween(LocalDate, LocalDate) but here you pass LocalDate String representations which must follow ISO LocalDate format to allow calling LocalDate#parse(CharSequence) method.

Example:

 LocalDate firstOfJanuary2000 = LocalDate.parse("2000-01-01");

// assertions succeed:
assertThat(firstOfJanuary2000).isBetween("1999-01-01", "2001-01-01")
                              .isBetween("2000-01-01", "2001-01-01")
                              .isBetween("1999-01-01", "2000-01-01")
                              .isBetween("2000-01-01", "2000-01-01");

// assertion fails:
assertThat(firstOfJanuary2000).isBetween("1999-01-01", "1999-12-31");
Parameters
startInclusive:String

the start value (inclusive), expected not to be null.

endInclusive:String

the end value (inclusive), expected not to be null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in [start, end] period.
NullPointerException:
  • if start value is null.
  • if end value is null.
DateTimeParseException:
if any of the given String can't be converted to a LocalDate.
Since
3.7.1
isEqualToback to summary
public SELF isEqualTo(String localDateAsString)

Same assertion as 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 String in comparison to avoid writing the code to perform the conversion
assertThat(parse("2000-01-01")).isEqualTo("2000-01-01");
Parameters
localDateAsString:String

String representing a LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not equal to the LocalDate built from given String.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isInback to summary
public SELF isIn(String... localDatesAsString)

Same assertion as 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");
Parameters
localDatesAsString:String[]

String array representing LocalDates.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not in the LocalDates built from given Strings.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isInTheFutureback to summary
public SELF isInTheFuture()

Verifies that the actual LocalDate is strictly in the future.

Example:

 // assertion succeeds:
assertThat(LocalDate.now().plusDays(1)).isInTheFuture();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not in the future.
Since
3.25.0
isInThePastback to summary
public SELF isInThePast()

Verifies that the actual LocalDate is strictly in the past.

Example:

 // assertion succeeds:
assertThat(LocalDate.now().minusDays(1)).isInThePast();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not in the past.
Since
3.25.0
isNotEqualToback to summary
public SELF isNotEqualTo(String localDateAsString)

Same assertion as 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 String in comparison to avoid writing the code to perform the conversion
assertThat(parse("2000-01-01")).isNotEqualTo("2000-01-15");
Parameters
localDateAsString:String

String representing a LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is equal to the LocalDate built from given String.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isNotInback to summary
public SELF isNotIn(String... localDatesAsString)

Same assertion as 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");
Parameters
localDatesAsString:String[]

Array of String representing a LocalDate.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is in the LocalDates built from given Strings.
IllegalArgumentException:
if given String is null or can't be converted to a LocalDate.
isStrictlyBetweenback to summary
public SELF isStrictlyBetween(LocalDate startExclusive, LocalDate endExclusive)

Verifies that the actual LocalDate is in the ]start, end[ period (start and end excluded).

Example:

 LocalDate localDate = LocalDate.now();

// assertion succeeds:
assertThat(localDate).isStrictlyBetween(localDate.minusDays(1), localDate.plusDays(1));

// assertions fail:
assertThat(localDate).isStrictlyBetween(localDate.minusDays(10), localDate.minusDays(1));
assertThat(localDate).isStrictlyBetween(localDate.plusDays(1), localDate.plusDays(10));
assertThat(localDate).isStrictlyBetween(localDate, localDate.plusDays(1));
assertThat(localDate).isStrictlyBetween(localDate.minusDays(1), localDate);
Parameters
startExclusive:LocalDate

the start value (exclusive), expected not to be null.

endExclusive:LocalDate

the end value (exclusive), expected not to be null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in ]start, end[ period.
NullPointerException:
  • if start value is null.
  • if end value is null.
Since
3.7.1
isStrictlyBetweenback to summary
public SELF isStrictlyBetween(String startExclusive, String endExclusive)

Same assertion as isStrictlyBetween(LocalDate, LocalDate) but here you pass LocalDate String representations which must follow ISO LocalDate format to allow calling LocalDate#parse(CharSequence) method.

Example:

 LocalDate firstOfJanuary2000 = LocalDate.parse("2000-01-01");

// assertion succeeds:
assertThat(firstOfJanuary2000).isStrictlyBetween("1999-01-01", "2001-01-01");

// assertions fail:
assertThat(firstOfJanuary2000).isStrictlyBetween("1999-01-01", "1999-12-31");
assertThat(firstOfJanuary2000).isStrictlyBetween("2000-01-01", "2001-01-01");
assertThat(firstOfJanuary2000).isStrictlyBetween("1999-01-01", "2000-01-01");
Parameters
startExclusive:String

the start value (exclusive), expected not to be null.

endExclusive:String

the end value (exclusive), expected not to be null.

Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual value is null.
  • if the actual value is not in ]start, end[ period.
NullPointerException:
  • if start value is null.
  • if end value is null.
DateTimeParseException:
if any of the given String can't be converted to a LocalDate.
Since
3.7.1
isTodayback to summary
public SELF isToday()

Verifies that the actual LocalDate is today, that is matching current year, month and day.

Example:

 // assertion succeeds:
assertThat(LocalDate.now()).isToday();

// assertion will fail
assertThat(theFellowshipOfTheRing.getReleaseDate()).isToday();
Returns:SELF

this assertion object.

Exceptions
AssertionError:
  • if the actual LocalDate is null.
  • if the actual LocalDate is not today.
parseback to summary
protected LocalDate parse(String localDateAsString)

Implements abstract org.assertj.core.api.AbstractTemporalAssert.parse.

Doc from org.assertj.core.api.AbstractTemporalAssert.parse.

Obtains an instance of TEMPORAL from a string representation in ISO date format.

Parameters
localDateAsString:String

the string to parse, not null

Returns:LocalDate

the parsed TEMPORAL, not null

Annotations
@Override