Top Fields Constructors Methods
org.assertj.core.api

public abstract Class AbstractZonedDateTimeAssert<SELF extends AbstractZonedDateTimeAssert<SELF>>

extends AbstractTemporalAssert<SELF extends AbstractZonedDateTimeAssert<SELF>, ZonedDateTime>
Class Inheritance
Known Direct Subclasses
org.assertj.core.api.ZonedDateTimeAssert
Static Imports
org.assertj.core.error.ShouldBeEqualIgnoringHours.shouldBeEqualIgnoringHours, .ShouldBeEqualIgnoringMinutes.shouldBeEqualIgnoringMinutes, .ShouldBeEqualIgnoringNanos.shouldBeEqualIgnoringNanos, .ShouldBeEqualIgnoringSeconds.shouldBeEqualIgnoringSeconds, .ShouldBeInTheFuture.shouldBeInTheFuture, .ShouldBeInThePast.shouldBeInThePast, org.assertj.core.util.Preconditions.checkArgument

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

Method Summary

Modifier and TypeMethod and Description
private static boolean

Returns:

true if both datetime are in the same year, month, day of month and hour, false otherwise.
areEqualIgnoringMinutes
(ZonedDateTime
the actual datetime. expected not be null
actual
,
ZonedDateTime
the other datetime. expected not be null
other
)

Returns true if both datetime are in the same year, month, day of month and hour, false otherwise.

private static boolean

Returns:

true if both datetime are in the same year, month and day of month, hour, minute and second, false otherwise.
areEqualIgnoringNanos
(ZonedDateTime
the actual datetime. expected not be null
actual
,
ZonedDateTime
the other datetime. expected not be null
other
)

Returns true if both datetime are in the same year, month and day of month, hour, minute and second, false otherwise.

private static boolean

Returns:

true if both datetime are in the same year, month, day of month, hour and minute, false otherwise.
areEqualIgnoringSeconds
(ZonedDateTime
the actual datetime. expected not be null
actual
,
ZonedDateTime
the other datetime. expected not be null
other
)

Returns true if both datetime are in the same year, month, day of month, hour and minute, false otherwise.

private static void
assertDateTimeAsStringParameterIsNotNull(String
String representing the ZonedDateTime to compare actual with
dateTimeAsString
)

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

private static void
assertDateTimeParameterIsNotNull(ZonedDateTime
the ZonedDateTime to check
dateTime
)

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

private Comparables
private ZonedDateTime[]
private void
private ZonedDateTime[]
convertToDateTimeArray(String... dateTimesAsString)

private static boolean

Returns:

true if both datetime are in the same year, false otherwise
haveSameYear
(ZonedDateTime
the actual datetime. expected not be null
actual
,
ZonedDateTime
the other datetime. expected not be null
other
)

Returns true if both datetime are in the same year, false otherwise.

private static boolean

Returns:

true if both datetime are in the same year and month, false otherwise
haveSameYearAndMonth
(ZonedDateTime
the actual datetime. expected not be null
actual
,
ZonedDateTime
the other datetime. expected not be null
other
)

Returns true if both datetime are in the same year and month, false otherwise.

private static boolean

Returns:

true if both datetime are in the same year, month and day of month, false otherwise
haveSameYearMonthAndDayOfMonth
(ZonedDateTime
the actual datetime. expected not be null
actual
,
ZonedDateTime
the other datetime. expected not be null
other
)

Returns true if both datetime are in the same year, month and day of month, false otherwise.

public SELF

Returns:

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

Verifies that the actual ZonedDateTime is strictly after the given one according to the comparator in use.

public SELF

Returns:

this assertion object.
isAfter
(String
String representing a ZonedDateTime.
dateTimeAsString
)

Same assertion as isAfter(ZonedDateTime) but the ZonedDateTime is built from given String, which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

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

Verifies that the actual ZonedDateTime is after or equals to the given one according to the comparator in use.

public SELF

Returns:

this assertion object.
isAfterOrEqualTo
(String
String representing a ZonedDateTime.
dateTimeAsString
)

Same assertion as isAfterOrEqualTo(ZonedDateTime) but the ZonedDateTime is built from given String which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

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

Verifies that the actual ZonedDateTime is strictly before the given one according to the comparator in use.

public SELF

Returns:

this assertion object.
isBefore
(String
String representing a ZonedDateTime.
dateTimeAsString
)

Same assertion as isBefore(ZonedDateTime) but the ZonedDateTime is built from given String, which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

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

Verifies that the actual ZonedDateTime is before or equals to the given one according to the comparator in use.

public SELF

Returns:

this assertion object.
isBeforeOrEqualTo
(String
String representing a ZonedDateTime.
dateTimeAsString
)

Same assertion as isBeforeOrEqualTo(ZonedDateTime) but the ZonedDateTime is built from given String which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

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

Verifies that the actual ZonedDateTime is in the [start, end] period (start and end included) according to the comparator in use.

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(ZonedDateTime, ZonedDateTime) but here you pass ZonedDateTime String representations which must follow ISO ZonedDateTime format to allow calling ZonedDateTime#parse(CharSequence) method.

public SELF

Returns:

this assertion object
isCloseTo
(ZonedDateTime
the ZonedDateTime to compare actual to
other
,
TemporalOffset<? super ZonedDateTime>
the offset used for comparison
offset
)

Overrides org.assertj.core.api.AbstractTemporalAssert.isCloseTo.

Verifies that the actual ZonedDateTime is close to the other according to the given TemporalOffset.
public SELF

Returns:

this assertion object.
isEqualTo
(Object
the given value to compare the actual value to.
expected
)

Overrides org.assertj.core.api.AbstractAssert.isEqualTo.

Implements org.assertj.core.api.Assert.isEqualTo.

Verifies that the actual ZonedDateTime is equal to the given one according to the comparator in use.
public SELF

Returns:

this assertion object.
isEqualTo
(String
String representing a ZonedDateTime.
dateTimeAsString
)

Same assertion as isEqualTo(Object) but the ZonedDateTime is built from given String which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

this assertion object.
isEqualToIgnoringHours
(ZonedDateTime
the given ZonedDateTime.
other
)

Deprecated Use isCloseTo(ZonedDateTime, TemporalOffset) instead, although not exactly the same semantics, this is the right way to compare with a given precision.
Verifies that actual and given ZonedDateTime have same year, month and day fields (hour, minute, second and nanosecond fields are ignored in comparison).
public SELF

Returns:

this assertion object.
isEqualToIgnoringMinutes
(ZonedDateTime
the given ZonedDateTime.
other
)

Deprecated Use isCloseTo(ZonedDateTime, TemporalOffset) instead, although not exactly the same semantics, this is the right way to compare with a given precision.
Verifies that actual and given ZonedDateTime have same year, month, day and hour fields (minute, second and nanosecond fields are ignored in comparison).
public SELF

Returns:

this assertion object.
isEqualToIgnoringNanos
(ZonedDateTime
the given ZonedDateTime.
other
)

Deprecated Use isCloseTo(ZonedDateTime, TemporalOffset) instead, although not exactly the same semantics, this is the right way to compare with a given precision.
Verifies that actual and given ZonedDateTime have same year, month, day, hour, minute and second fields, (nanosecond fields are ignored in comparison).
public SELF

Returns:

this assertion object.
isEqualToIgnoringSeconds
(ZonedDateTime
the given ZonedDateTime.
other
)

Deprecated Use isCloseTo(ZonedDateTime, TemporalOffset) instead, although not exactly the same semantics, this is the right way to compare with a given precision.
Verifies that actual and given ZonedDateTime have same year, month, day, hour and minute fields (second and nanosecond fields are ignored in comparison).
public SELF

Returns:

this assertion object.
isIn
(ZonedDateTime...
the given ZonedDateTimes to compare the actual value to.
expected
)

Verifies that the actual ZonedDateTime is equal to one of the given ZonedDateTime in the actual ZonedDateTime's java.time.ZoneId.

public SELF

Returns:

this assertion object.
isIn
(String...
String array representing ZonedDateTimes.
dateTimesAsString
)

Same assertion as isIn(ZonedDateTime...) but the ZonedDateTime are built from given String, which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

this assertion object.
isInTheFuture
()

Verifies that the actual ZonedDateTime is strictly in the future.

public SELF

Returns:

this assertion object.
isInThePast
()

Verifies that the actual ZonedDateTime is strictly in the past.

public SELF

Returns:

this assertion object.
isNotEqualTo
(Object
the given value to compare the actual value to.
expected
)

Overrides org.assertj.core.api.AbstractAssert.isNotEqualTo.

Implements org.assertj.core.api.Assert.isNotEqualTo.

Verifies that the actual value is not equal to the given one according to the comparator in use.
public SELF

Returns:

this assertion object.
isNotEqualTo
(String
String representing a ZonedDateTime.
dateTimeAsString
)

Same assertion as #isNotEqualTo(Object) but the ZonedDateTime is built from given String which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

this assertion object.
isNotIn
(ZonedDateTime...
the given ZonedDateTimes to compare the actual value to.
expected
)

Verifies that the actual ZonedDateTime is equal to one of the given ZonedDateTime in the actual ZonedDateTime's java.time.ZoneId.

public SELF

Returns:

this assertion object.
isNotIn
(String...
String array representing ZonedDateTimes.
dateTimesAsString
)

Same assertion as isNotIn(ZonedDateTime...) but the ZonedDateTime is built from given String, which must follow ISO date-time format to allow calling ZonedDateTime#parse(CharSequence, DateTimeFormatter) method.

public SELF

Returns:

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

Verifies that the actual ZonedDateTime is in the ]start, end[ period (start and end excluded) according to the comparator in use.

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(ZonedDateTime, ZonedDateTime) but here you pass ZonedDateTime String representations which must follow ISO ZonedDateTime format to allow calling ZonedDateTime#parse(CharSequence) method.

protected ZonedDateTime

Returns:

the parsed ZonedDateTime
parse
(String
the string to parse
dateTimeAsString
)

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

Obtains an instance of ZonedDateTime from a string representation in ISO date format.
private ZonedDateTime
public SELF
usingDefaultComparator()

Overrides org.assertj.core.api.AbstractTemporalAssert.usingDefaultComparator.

Implements org.assertj.core.api.Assert.usingDefaultComparator.

Revert to standard comparison for the incoming assertion checks.
Inherited from org.assertj.core.api.AbstractTemporalAssert:
getActualisCloseTousingComparatorusingComparator