toBeAfter
Expects that the subject of this
expectation (a ChronoLocalDate) is after the expected.
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Samples
expect(LocalDate.of(2021, Month.AUGUST, 6)) toBeAfter LocalDate.of(2021, Month.JULY, 1)
Expects that the subject of this
expectation (a ChronoLocalDate) is after the expected given as String.
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Throws
in case expected is not in the form of yyyy-mm-dd
Samples
expect(LocalDate.of(2021, Month.AUGUST, 6)) toBeAfter "2021-07-01"
Expects that the subject of this
expectation (a ChronoLocalDateTime) is after the expected.
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Samples
expect(LocalDateTime.of(2021, Month.JUNE, 6, 12, 10, 0, 0)) toBeAfter LocalDateTime.of(2021, Month.JUNE, 6, 10, 5, 35, 103)
Expects that the subject of this
expectation (a ChronoLocalDateTime) is before the expected given as String in (modified) ISO 8601 format. The string will be converted to a LocalDateTime according to ISO 8601 but with a slight deviation. The alternative notation (e.g. 20200401120001 instead of 2020-04-01T12:00:01) is not supported and we accept a date without time in which case 00:00:00 is used. Following the supported formats from the longest to the shortest: yyyy-mm-ddThh:mm:ss.sss (up to 9 digits for nanoseconds) yyyy-mm-ddThh:mm:ss yyyy-mm-ddThh:mm yyyy-mm-dd
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Throws
in case an unsupported format is given.
Samples
expect(LocalDateTime.of(2021, Month.JUNE, 6, 12, 10, 0, 0)) toBeAfter "2021-06-06T10:05:35.103000000"
// format yyyy-MM-ddThh:mm:SS can be used, in which case .000000000 is used for the omitted part
expect(LocalDateTime.of(2021, Month.JUNE, 6, 12, 10, 0, 0)) toBeAfter "2021-06-06T10:05:35"
// format yyyy-MM-ddThh:mm can be used, in which case 00.000000000 is used for the omitted part
expect(LocalDateTime.of(2021, Month.JUNE, 6, 12, 10, 0, 0)) toBeAfter "2021-06-06T10:05"
// format yyyy-MM-dd can be used, in which case 00:00:00.000000000 is used for the omitted part
expect(LocalDateTime.of(2021, Month.JUNE, 6, 12, 10, 0, 0)) toBeAfter "2021-06-06"
Expects that the subject of this
expectation (a ChronoZonedDateTime) is after the expected.
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Samples
expect(ZonedDateTime.of(2021, 6, 6, 12, 10, 0, 0, ZoneId.of("America/Sao_Paulo"))) toBeAfter ZonedDateTime.of(2021, 6, 6, 10, 5, 35, 103, ZoneId.of("America/Sao_Paulo"))
Expects that the subject of this
expectation (a ChronoZonedDateTime) is before or equals the expected given as String.
The format is composed of {DateTime}{ZoneDesignator}.
DateTime:
yyyy-mm-ddThh:mm:ss.SSS (up to 9 digits for nanoseconds)
yyyy-mm-ddThh:mm:ss
yyyy-mm-ddThh:mm
yyyy-mm-dd
And for ZoneDesignator:
Z
+hh
+hh:mm
-hh
-hh:mm
Here are some examples on how it can look combined
2020-01-02T03:04:05Z
2020-01-02T03:04Z
2020-01-02Z
2020-01-02+01:30
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Throws
in case an unsupported format is given.
Samples
expect(ZonedDateTime.of(2021, 6, 6, 12, 10, 0, 0, ZoneId.of("America/Sao_Paulo"))) toBeAfter "2021-06-06T10:05:35.103000000-03:00"
// format yyyy-MM-ddThh:mm:SS can be used, in which case .000000000 is used for the omitted part
expect(ZonedDateTime.of(2021, 6, 6, 12, 10, 0, 0, ZoneId.of("America/Sao_Paulo"))) toBeAfter "2021-06-06T10:05:35-03:00"
// format yyyy-MM-ddThh:mm can be used, in which case 00.000000000 is used for the omitted part
expect(ZonedDateTime.of(2021, 6, 6, 12, 10, 0, 0, ZoneId.of("America/Sao_Paulo"))) toBeAfter "2021-06-06T10:05-03:00"
// format yyyy-MM-dd can be used, in which case 00:00:00.000000000 is used for the omitted part
expect(ZonedDateTime.of(2021, 6, 6, 12, 10, 0, 0, ZoneId.of("America/Sao_Paulo"))) toBeAfter "2021-06-06-03:00"