public abstract class DateMatchers extends Object
Matcher instances for comparing dates| Modifier and Type | Field and Description |
|---|---|
static String |
UNSUPPORTED_SQL_DATE_UNIT |
| Constructor and Description |
|---|
DateMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static TemporalMatcher<Date> |
after(Date date)
Creates a matcher that matches when the examined date is after the reference date
For example:
|
static TemporalMatcher<Date> |
after(Date date)
Creates a matcher that matches when the examined date is after the reference date
For example:
|
static TemporalMatcher<Date> |
after(DayMonthYear date)
Deprecated.
Use
after(LocalDate) |
static TemporalMatcher<Date> |
after(Instant date)
Creates a matcher that matches when the examined date is after the reference date
For example:
|
static TemporalMatcher<Date> |
after(int year,
Month month,
int day)
Creates a matcher that matches when the examined date is after the end of the reference year
For example:
|
static TemporalMatcher<Date> |
after(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second)
Creates a matcher that matches when the examined date is after the end of the reference year
For example:
|
static TemporalMatcher<Date> |
after(int year,
Months month,
int day)
Deprecated.
|
static TemporalMatcher<Date> |
after(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static TemporalMatcher<Date> |
after(LocalDate date)
Creates a matcher that matches when the examined date is after the reference date
For example:
|
static TemporalMatcher<Date> |
after(LocalDateTime date)
Creates a matcher that matches when the examined date is after the reference date
For example:
|
static TemporalMatcher<Date> |
before(Date date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static TemporalMatcher<Date> |
before(Date date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static TemporalMatcher<Date> |
before(DayMonthYear date)
Deprecated.
|
static TemporalMatcher<Date> |
before(Instant date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static TemporalMatcher<Date> |
before(int year,
Month month,
int day)
Creates a matcher that matches when the examined date is before the end of the reference year
For example:
|
static TemporalMatcher<Date> |
before(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second)
Creates a matcher that matches when the examined date is before the end of the reference year
For example:
|
static TemporalMatcher<Date> |
before(int year,
Months month,
int day)
Deprecated.
|
static TemporalMatcher<Date> |
before(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static TemporalMatcher<Date> |
before(LocalDate date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static TemporalMatcher<Date> |
before(LocalDateTime date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static TemporalMatcher<Date> |
isApril()
Creates a matcher that matches when the examined date is in April
For example:
|
static TemporalMatcher<Date> |
isAugust()
Creates a matcher that matches when the examined date is in August
For example:
|
static TemporalMatcher<Date> |
isDay(int year,
Month month,
int dayOfMonth)
Creates a matcher that matches when the examined date is on the same day of the year as the reference date
For example:
|
static TemporalMatcher<Date> |
isDayOfMonth(int dayOfMonth)
Creates a matcher that matches when the examined date is on the expected day of the month
For example:
|
static TemporalMatcher<Date> |
isDayOfWeek(DayOfWeek... daysOfWeek)
Creates a matcher that matches when the examined date is on the same day of the week as any of the supplied days
For example:
|
static TemporalMatcher<Date> |
isDayOfWeek(DayOfWeek dayOfWeek)
Creates a matcher that matches when the examined date is on the same day of the week as the supplied day
For example:
|
static TemporalMatcher<Date> |
isDayOfWeek(Weekdays dayOfWeek)
Deprecated.
|
static TemporalMatcher<Date> |
isDecember()
Creates a matcher that matches when the examined date is in December
For example:
|
static TemporalMatcher<Date> |
isFebruary()
Creates a matcher that matches when the examined date is in February
For example:
|
static TemporalMatcher<Date> |
isFirstDayOfMonth()
Creates a matcher that matches when the examined date is on the first day of the month
For example:
|
static TemporalMatcher<Date> |
isFriday()
Creates a matcher that matches when the examined date is on a friday
For example:
|
static TemporalMatcher<Date> |
isHour(int hour)
Creates a matcher that matches when the examined date is on the same hour as the reference date
For example:
|
static TemporalMatcher<Date> |
isInstant(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second,
int milliseconds)
Creates a matcher that matches when the examined date is on the same instance as the reference date
For example:
|
static TemporalMatcher<Date> |
isJanuary()
Creates a matcher that matches when the examined date is in January
For example:
|
static TemporalMatcher<Date> |
isJuly()
Creates a matcher that matches when the examined date is in July
For example:
|
static TemporalMatcher<Date> |
isJune()
Creates a matcher that matches when the examined date is in June
For example:
|
static TemporalMatcher<Date> |
isLastDayOfMonth()
Creates a matcher that matches when the examined date is on the first day of the month
For example:
|
static TemporalMatcher<Date> |
isLeapYear()
Creates a matcher that matches when the examined date is a leap year
For example:
|
static TemporalMatcher<Date> |
isMarch()
Creates a matcher that matches when the examined date is in March
For example:
|
static TemporalMatcher<Date> |
isMaximum(ChronoField field)
Creates a matcher that matches when the examined date is on the maximum value of the given date part in its
period
For example:
|
static TemporalMatcher<Date> |
isMay()
Creates a matcher that matches when the examined date is in May
For example:
|
static TemporalMatcher<Date> |
isMillisecond(int millisecond)
Creates a matcher that matches when the examined date is on the reference second
For example:
|
static TemporalMatcher<Date> |
isMinimum(ChronoField field)
Creates a matcher that matches when the examined date is on the maximum value of the given date part in its
period
For example:
|
static TemporalMatcher<Date> |
isMinute(int minute)
Creates a matcher that matches when the examined date is on the reference minute
For example:
|
static TemporalMatcher<Date> |
isMonday()
Creates a matcher that matches when the examined date is on a monday
For example:
|
static TemporalMatcher<Date> |
isMonth(Month month)
Creates a matcher that matches when the examined date is in the expected month
For example:
|
static TemporalMatcher<Date> |
isNovember()
Creates a matcher that matches when the examined date is in November
For example:
|
static TemporalMatcher<Date> |
isOctober()
Creates a matcher that matches when the examined date is in October
For example:
|
static TemporalMatcher<Date> |
isSaturday()
Creates a matcher that matches when the examined date is on a saturday
For example:
|
static TemporalMatcher<Date> |
isSecond(int second)
Creates a matcher that matches when the examined date is on the reference second
For example:
|
static TemporalMatcher<Date> |
isSeptember()
Creates a matcher that matches when the examined date is in September
For example:
|
static TemporalMatcher<Date> |
isSunday()
Creates a matcher that matches when the examined date is on a sunday
For example:
|
static TemporalMatcher<Date> |
isThursday()
Creates a matcher that matches when the examined date is on a thursday
For example:
|
static TemporalMatcher<Date> |
isToday()
Creates a matcher that matches when the examined date is today
For example:
|
static TemporalMatcher<Date> |
isTomorrow()
Creates a matcher that matches when the examined date is tomorrow
For example:
|
static TemporalMatcher<Date> |
isTuesday()
Creates a matcher that matches when the examined date is on a tuesday
For example:
|
static TemporalMatcher<Date> |
isWednesday()
Creates a matcher that matches when the examined date is on a wednesday
For example:
|
static TemporalMatcher<Date> |
isWeekday()
Creates a matcher that matches when the examined date is on a weekday
For example:
|
static TemporalMatcher<Date> |
isWeekend()
Creates a matcher that matches when the examined date is on a weekend
For example:
|
static TemporalMatcher<Date> |
isYear(int year)
Creates a matcher that matches when the examined date is on the same year as the reference year
For example:
|
static TemporalMatcher<Date> |
isYesterday()
Creates a matcher that matches when the examined date is yesterday
For example:
|
static TemporalMatcher<Date> |
sameDay(Date date)
Creates a matcher that matches when the examined date is on the same day of the year as the reference date
For example:
|
static TemporalMatcher<Date> |
sameDay(Date date)
Creates a matcher that matches when the examined date is on the same day of the year as the reference date
For example:
|
static TemporalMatcher<Date> |
sameDay(DayMonthYear date)
Deprecated.
|
static TemporalMatcher<Date> |
sameDay(int year,
Months month,
int day)
Deprecated.
|
static TemporalMatcher<Date> |
sameDay(LocalDate date)
Creates a matcher that matches when the examined date is on the same day of the year as the reference date
For example:
|
static TemporalMatcher<Date> |
sameDayOfMonth(Date date)
Creates a matcher that matches when the examined date is on the same day of the month as the reference date
For example:
|
static TemporalMatcher<Date> |
sameDayOfWeek(Date date)
Creates a matcher that matches when the examined date is on the same day of the week as the reference date
For example:
|
static TemporalMatcher<Date> |
sameDayOfWeek(Date date)
Creates a matcher that matches when the examined date is on the same day of the week as the reference date
For example:
|
static TemporalMatcher<Date> |
sameHour(Date date)
Deprecated.
Use
sameHourOfDay(Date) instead |
static TemporalMatcher<Date> |
sameHour(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameHour(int hour)
Deprecated.
Use
isHour(int) instead |
static TemporalMatcher<Date> |
sameHourOfDay(Date date)
Creates a matcher that matches when the examined date is on the same hour as the reference date
For example:
|
static TemporalMatcher<Date> |
sameHourOfDay(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameInstant(Date date)
Creates a matcher that matches when the examined date is on the same instant as the reference date
For example:
|
static TemporalMatcher<Date> |
sameInstant(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameInstant(Instant instant)
Creates a matcher that matches when the examined date is on the same UTC instant as the reference Instant
supplied
For example:
|
static TemporalMatcher<Date> |
sameInstant(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second,
int milliseconds)
Deprecated.
|
static TemporalMatcher<Date> |
sameInstant(long timestamp)
Creates a matcher that matches when the examined date is on the same UTC instant as the reference UTC epoch time
supplied
For example:
|
static TemporalMatcher<Date> |
sameMillisecond(Date date)
Deprecated.
Use
sameMillisecondOfSecond(Date) instead |
static TemporalMatcher<Date> |
sameMillisecond(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameMillisecond(int millisecond)
Deprecated.
Use
isMillisecond(int) instead |
static TemporalMatcher<Date> |
sameMillisecondOfSecond(Date date)
Creates a matcher that matches when the examined date is on the same millisecond as the reference date
For example:
|
static TemporalMatcher<Date> |
sameMillisecondOfSecond(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameMinute(Date date)
Deprecated.
Use
sameMinuteOfHour(Date) instead |
static TemporalMatcher<Date> |
sameMinute(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameMinute(int minute)
Deprecated.
Use
isMinute(int) instead |
static TemporalMatcher<Date> |
sameMinuteOfHour(Date date)
Creates a matcher that matches when the examined date is on the same minute as the reference date
For example:
|
static TemporalMatcher<Date> |
sameMinuteOfHour(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameMonth(Date date)
Deprecated.
Use
sameMonthOfYear(Date) instead |
static TemporalMatcher<Date> |
sameMonth(Date date)
Deprecated.
Use
sameMonthOfYear(Date) instead |
static TemporalMatcher<Date> |
sameMonth(Months month)
Deprecated.
Use
sameMonthOfYear(Months) instead |
static TemporalMatcher<Date> |
sameMonthOfYear(Date date)
Creates a matcher that matches when the examined date is on the same month as the reference date
For example:
|
static TemporalMatcher<Date> |
sameMonthOfYear(Date date)
Creates a matcher that matches when the examined date is on the same month as the reference date
For example:
|
static TemporalMatcher<Date> |
sameMonthOfYear(Months month)
Deprecated.
Use
isMonth(Month) |
static TemporalMatcher<Date> |
sameOrAfter(Date date)
F Creates a matcher that matches when the examined date is at the same instant or after the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrAfter(Date date)
F Creates a matcher that matches when the examined date is at the same instant or after the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrAfter(DayMonthYear date)
Deprecated.
|
static TemporalMatcher<Date> |
sameOrAfter(int year,
Month month,
int dayOfMonth)
Creates a matcher that matches when the examined date is on the same day or after the start of the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrAfter(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second)
Creates a matcher that matches when the examined date is on the same second or after the start of the reference
date and time
For example:
|
static TemporalMatcher<Date> |
sameOrAfter(int year,
Months month,
int dayOfMonth)
Deprecated.
Use {@link #sameOrAfter(int, Month, int)
|
static TemporalMatcher<Date> |
sameOrAfter(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static TemporalMatcher<Date> |
sameOrAfter(LocalDate date)
F Creates a matcher that matches when the examined date is at the same instant or after the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrAfter(LocalDateTime date)
F Creates a matcher that matches when the examined date is at the same instant or after the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrBefore(Date date)
Creates a matcher that matches when the examined date is at the same instant or before the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrBefore(Date date)
Creates a matcher that matches when the examined date is at the same instant or before the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrBefore(DayMonthYear date)
Deprecated.
|
static TemporalMatcher<Date> |
sameOrBefore(int year,
Month month,
int dayOfMonth)
Creates a matcher that matches when the examined date is on the same day or before the start of the reference
date
For example:
|
static TemporalMatcher<Date> |
sameOrBefore(int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second)
Creates a matcher that matches when the examined date is on the same second or before the start of the reference
date and time
For example:
|
static TemporalMatcher<Date> |
sameOrBefore(int year,
Months month,
int dayOfMonth)
Deprecated.
|
static TemporalMatcher<Date> |
sameOrBefore(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static TemporalMatcher<Date> |
sameOrBefore(LocalDate date)
Creates a matcher that matches when the examined date is at the same instant or before the reference date
For example:
|
static TemporalMatcher<Date> |
sameOrBefore(LocalDateTime date)
Creates a matcher that matches when the examined date is at the same instant or before the reference date
For example:
|
static TemporalMatcher<Date> |
sameSecond(Date date)
Deprecated.
Use
sameSecondOfMinute(Date) instead |
static TemporalMatcher<Date> |
sameSecond(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameSecond(int second)
Deprecated.
Use
isSecond(int) instead |
static TemporalMatcher<Date> |
sameSecondOfMinute(Date date)
Creates a matcher that matches when the examined date is on the same second as the reference date
For example:
|
static TemporalMatcher<Date> |
sameSecondOfMinute(Date date)
Deprecated.
java.sql.Date does not support time-based comparisons. Prefer
SqlDateMatchers for
java.sql.Date appropriate matchers |
static TemporalMatcher<Date> |
sameYear(Date date)
Creates a matcher that matches when the examined date is on the same year as the reference date
For example:
|
static TemporalMatcher<Date> |
sameYear(Date date)
Creates a matcher that matches when the examined date is on the same year as the reference date
For example:
|
static TemporalMatcher<Date> |
within(long period,
ChronoUnit unit,
Date date)
Creates a matcher that matches when the examined date is within a defined period the reference date
For example:
|
static TemporalMatcher<Date> |
within(long period,
ChronoUnit unit,
Date date)
Creates a matcher that matches when the examined date is within a defined period the reference date
For example:
|
static TemporalMatcher<Date> |
within(long period,
ChronoUnit unit,
int year,
Month month,
int dayOfMonth)
Creates a matcher that matches when the examined date is within a given period of the reference date
For example:
|
static TemporalMatcher<Date> |
within(long period,
ChronoUnit unit,
int year,
Month month,
int dayOfMonth,
int hour,
int minute,
int second,
int milliseconds)
Creates a matcher that matches when the examined date is within a given period of the reference date
For example:
|
static TemporalMatcher<Date> |
within(long period,
ChronoUnit unit,
LocalDate date)
Creates a matcher that matches when the examined date is within a defined period the reference date
For example:
|
static TemporalMatcher<Date> |
within(long period,
ChronoUnit unit,
LocalDateTime date)
Creates a matcher that matches when the examined date is within a defined period the reference date
For example:
|
static TemporalMatcher<Date> |
within(long period,
TimeUnit unit,
Date date)
Deprecated.
|
static TemporalMatcher<Date> |
within(long period,
TimeUnit unit,
Date date)
Deprecated.
|
static TemporalMatcher<Date> |
within(long period,
TimeUnit unit,
DayMonthYear date)
Deprecated.
|
static TemporalMatcher<Date> |
within(long period,
TimeUnit unit,
int year,
Months month,
int dayOfMonth)
Deprecated.
|
static TemporalMatcher<Date> |
within(long period,
TimeUnit unit,
int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second,
int milliseconds)
Deprecated.
|
public static final String UNSUPPORTED_SQL_DATE_UNIT
public static TemporalMatcher<Date> after(Date date)
assertThat(myDate, after(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> after(Date date)
assertThat(myDate, after(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> after(DayMonthYear date)
after(LocalDate)assertThat(myDate, after(Moments.today()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> after(LocalDate date)
assertThat(myDate, after(Moments.today()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> after(LocalDateTime date)
assertThat(myDate, after(Moments.today()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> after(Instant date)
assertThat(myDate, after(Moments.today()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> after(int year, Months month, int day)
after(int, Month, int)assertThat(myDate, after(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkedday - the day of the month against which the examined date is checkedpublic static TemporalMatcher<Date> after(int year, Month month, int day)
assertThat(myDate, after(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkedday - the day of the month against which the examined date is checked@Deprecated public static TemporalMatcher<Date> after(int year, Months month, int dayOfMonth, int hour, int minute, int second)
after(int, Month, int, int, int, int)assertThat(myDate, after(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedpublic static TemporalMatcher<Date> after(int year, Month month, int dayOfMonth, int hour, int minute, int second)
assertThat(myDate, after(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedpublic static TemporalMatcher<Date> before(Date date)
assertThat(myDate, before(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> before(Date date)
assertThat(myDate, before(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> before(DayMonthYear date)
before(LocalDate)assertThat(myDate, before(Moments.today()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> before(LocalDate date)
assertThat(myDate, before(Moments.today()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> before(LocalDateTime date)
assertThat(myDate, before(Moments.today()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> before(Instant date)
assertThat(myDate, before(Moments.today()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> before(int year, Months month, int day)
before(int, Month, int)assertThat(myDate, before(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkedday - the day of the month against which the examined date is checkedpublic static TemporalMatcher<Date> before(int year, Month month, int day)
assertThat(myDate, before(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkedday - the day of the month against which the examined date is checked@Deprecated public static TemporalMatcher<Date> before(int year, Months month, int dayOfMonth, int hour, int minute, int second)
before(int, Month, int, int, int, int)assertThat(myDate, before(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedpublic static TemporalMatcher<Date> before(int year, Month month, int dayOfMonth, int hour, int minute, int second)
assertThat(myDate, before(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedpublic static TemporalMatcher<Date> sameDayOfWeek(Date date)
assertThat(myDate, sameWeekday(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameDayOfWeek(Date date)
assertThat(myDate, sameWeekday(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> isDayOfWeek(Weekdays dayOfWeek)
isDayOfWeek(DayOfWeek...)assertThat(myDate, isDayOfWeek(Weekdays.MONDAY))
dayOfWeek - the reference weekday against which the examined date is checkedpublic static TemporalMatcher<Date> isDayOfWeek(DayOfWeek dayOfWeek)
assertThat(myDate, isDayOfWeek(DayOfWeek.MONDAY))
dayOfWeek - the reference weekday against which the examined date is checkedpublic static TemporalMatcher<Date> isDayOfWeek(DayOfWeek... daysOfWeek)
assertThat(myDate, isDayOfWeek(DayOfWeek.MONDAY, DayOfWeek.TUESDAY))
daysOfWeek - the reference weekdays against which the examined date is checkedpublic static TemporalMatcher<Date> sameDayOfMonth(Date date)
assertThat(myDate, sameDayOfMonth(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> isDayOfMonth(int dayOfMonth)
assertThat(myDate, isDayOfMonth(4))
dayOfMonth - the expected day of the monthpublic static TemporalMatcher<Date> sameDay(Date date)
assertThat(myDate, sameDay(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameDay(Date date)
assertThat(myDate, sameDay(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameDay(DayMonthYear date)
sameDay(LocalDate)assertThat(myDate, sameDay(Moments.today()));
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameDay(LocalDate date)
assertThat(myDate, sameDay(Moments.today()));
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameDay(int year, Months month, int day)
isDay(int, Month, int)assertThat(myDate, sameDayOfTheYear(2012, Month.JAN, 1))
day - the reference day of the month against which the examined date is checkedmonth - the reference month against which the examined date is checkedyear - the reference year against which the examined date is checkedpublic static TemporalMatcher<Date> isDay(int year, Month month, int dayOfMonth)
assertThat(myDate, sameDayOfTheYear(2012, Month.JAN, 1))
dayOfMonth - the reference day of the month against which the examined date is checkedmonth - the reference month against which the examined date is checkedyear - the reference year against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameHour(Date date)
sameHourOfDay(Date) insteadassertThat(myDate, sameHour(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameHour(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionExceptionpublic static TemporalMatcher<Date> sameHourOfDay(Date date)
assertThat(myDate, sameHourOfDay(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameHourOfDay(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionException@Deprecated public static TemporalMatcher<Date> sameHour(int hour)
isHour(int) insteadassertThat(myDate, sameHour(12));
hour - the reference hour against which the examined date is checkedpublic static TemporalMatcher<Date> isHour(int hour)
assertThat(myDate, sameHour(12));
hour - the reference hour against which the examined date is checkedpublic static TemporalMatcher<Date> sameInstant(Date date)
assertThat(myDate, sameInstant(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameInstant(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionExceptionpublic static TemporalMatcher<Date> sameInstant(Instant instant)
assertThat(myDate, sameInstant(Instant.now()))
instant - the Instantpublic static TemporalMatcher<Date> sameInstant(long timestamp)
assertThat(myDate, sameInstant(1325415600000L))
timestamp - the time as milliseconds since the Unix epoch time@Deprecated public static TemporalMatcher<Date> sameInstant(int year, Months month, int dayOfMonth, int hour, int minute, int second, int milliseconds)
isInstant(int, Month, int, int, int, int, int)assertThat(myDate, sameInstant(2012, Months.MAY, 12, 23, 00, 01, 123));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedmilliseconds - the milliseconds of the second against which the examined date is checkedpublic static TemporalMatcher<Date> isInstant(int year, Month month, int dayOfMonth, int hour, int minute, int second, int milliseconds)
assertThat(myDate, sameInstant(2012, Months.MAY, 12, 23, 00, 01, 123));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedmilliseconds - the milliseconds of the second against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrBefore(Date date)
assertThat(myDate, sameOrBefore(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrBefore(Date date)
assertThat(myDate, sameOrBefore(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrBefore(LocalDate date)
assertThat(myDate, sameOrBefore(LocalDate.now()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrBefore(LocalDateTime date)
assertThat(myDate, sameOrBefore(LocalDateTime.now()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameOrBefore(DayMonthYear date)
sameOrBefore(LocalDate)assertThat(myDate, sameOrBefore(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameOrBefore(int year, Months month, int dayOfMonth)
sameOrBefore(int, Month, int)assertThat(myDate, sameOrBefore(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrBefore(int year, Month month, int dayOfMonth)
assertThat(myDate, sameOrBefore(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameOrBefore(int year, Months month, int dayOfMonth, int hour, int minute, int second)
sameOrBefore(int, Month, int, int, int, int)assertThat(myDate, sameOrBefore(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrBefore(int year, Month month, int dayOfMonth, int hour, int minute, int second)
assertThat(myDate, sameOrBefore(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrAfter(Date date)
assertThat(myDate, sameOrAfter(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrAfter(Date date)
assertThat(myDate, sameOrAfter(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrAfter(LocalDate date)
assertThat(myDate, sameOrAfter(LocalDate.now()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrAfter(LocalDateTime date)
assertThat(myDate, sameOrAfter(LocalDateTime.now()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameOrAfter(DayMonthYear date)
sameOrAfter(LocalDate)assertThat(myDate, sameOrAfter(Moments.today()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameOrAfter(int year, Months month, int dayOfMonth)
assertThat(myDate, sameOrAfter(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrAfter(int year, Month month, int dayOfMonth)
assertThat(myDate, sameOrAfter(2012, Months.MAY, 12));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameOrAfter(int year, Months month, int dayOfMonth, int hour, int minute, int second)
sameOrAfter(int, Month, int, int, int, int)assertThat(myDate, sameOrAfter(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedpublic static TemporalMatcher<Date> sameOrAfter(int year, Month month, int dayOfMonth, int hour, int minute, int second)
assertThat(myDate, sameOrAfter(2012, Months.MAY, 12, 23, 00, 01));
year - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMinute(Date date)
sameMinuteOfHour(Date) insteadassertThat(myDate, sameMinute(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMinute(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionExceptionpublic static TemporalMatcher<Date> sameMinuteOfHour(Date date)
assertThat(myDate, sameMinute(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMinuteOfHour(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionException@Deprecated public static TemporalMatcher<Date> sameMinute(int minute)
isMinute(int) insteadassertThat(myDate, sameMinute(55))
minute - the reference minute against which the examined date is checkedpublic static TemporalMatcher<Date> isMinute(int minute)
assertThat(myDate, sameMinute(55))
minute - the reference minute against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMonth(Date date)
sameMonthOfYear(Date) insteadassertThat(myDate, sameMonth(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMonth(Date date)
sameMonthOfYear(Date) insteadassertThat(myDate, sameMonth(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameMonthOfYear(Date date)
assertThat(myDate, sameMonth(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameMonthOfYear(Date date)
assertThat(myDate, sameMonth(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMonth(Months month)
sameMonthOfYear(Months) insteadassertThat(myDate, sameMonth(Months.DECEMBER))
month - the reference month against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMonthOfYear(Months month)
isMonth(Month)assertThat(myDate, sameMonth(Months.DECEMBER))
month - the reference month against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameSecond(Date date)
sameSecondOfMinute(Date) insteadassertThat(myDate, sameSecond(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameSecond(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionExceptionpublic static TemporalMatcher<Date> sameSecondOfMinute(Date date)
assertThat(myDate, sameSecond(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameSecondOfMinute(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionException@Deprecated public static TemporalMatcher<Date> sameSecond(int second)
isSecond(int) insteadassertThat(myDate, sameSecond(33))
second - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> isSecond(int second)
assertThat(myDate, sameSecond(33))
second - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMillisecond(Date date)
sameMillisecondOfSecond(Date) insteadassertThat(myDate, sameMillisecond(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMillisecond(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionExceptionpublic static TemporalMatcher<Date> sameMillisecondOfSecond(Date date)
assertThat(myDate, sameMillisecond(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> sameMillisecondOfSecond(Date date)
SqlDateMatchers for
java.sql.Date appropriate matchersdate - the reference date against which the examined date is checkedTemporalConversionException@Deprecated public static TemporalMatcher<Date> sameMillisecond(int millisecond)
isMillisecond(int) insteadassertThat(myDate, sameMillisecond(123))
millisecond - the millisecond against which the examined date is checkedpublic static TemporalMatcher<Date> isMillisecond(int millisecond)
assertThat(myDate, sameMillisecond(123))
millisecond - the millisecond against which the examined date is checkedpublic static TemporalMatcher<Date> sameYear(Date date)
assertThat(myDate, sameYear(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> sameYear(Date date)
assertThat(myDate, sameYear(new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> isYear(int year)
assertThat(myDate, sameYear(2013))
year - the reference year against which the examined date is checked@Deprecated public static TemporalMatcher<Date> within(long period, TimeUnit unit, Date date)
within(long, ChronoUnit, Date)assertThat(myDate, within(10, TimeUnit.MINUTES, new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> within(long period, ChronoUnit unit, Date date)
assertThat(myDate, within(10, TimeUnit.MINUTES, new Date()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> within(long period, TimeUnit unit, Date date)
within(long, ChronoUnit, Date)assertThat(myDate, within(10, TimeUnit.MINUTES, new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> within(long period, ChronoUnit unit, Date date)
assertThat(myDate, within(10, TimeUnit.MINUTES, new Date()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> within(long period, ChronoUnit unit, LocalDate date)
assertThat(myDate, within(10, ChronoUnit.DAYS, LocalDate.now()))
date - the reference date against which the examined date is checkedpublic static TemporalMatcher<Date> within(long period, ChronoUnit unit, LocalDateTime date)
assertThat(myDate, within(10, ChronoUnit.DAYS, LocalDateTime.now()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> within(long period, TimeUnit unit, DayMonthYear date)
within(long, ChronoUnit, LocalDate)assertThat(myDate, within(10, TimeUnit.DAYS, Moments.today()))
date - the reference date against which the examined date is checked@Deprecated public static TemporalMatcher<Date> within(long period, TimeUnit unit, int year, Months month, int dayOfMonth)
within(long, ChronoUnit, int, Month, int)assertThat(myDate, within(5, TimeUnit.DAYS, 2012, Months.MAY, 12));
period - the timeunit interval the examined date should be withunit - the timeunit to define the length of the periodyear - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedpublic static TemporalMatcher<Date> within(long period, ChronoUnit unit, int year, Month month, int dayOfMonth)
assertThat(myDate, within(5, TimeUnit.DAYS, 2012, Months.MAY, 12));
period - the timeunit interval the examined date should be withunit - the timeunit to define the length of the periodyear - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checked@Deprecated public static TemporalMatcher<Date> within(long period, TimeUnit unit, int year, Months month, int dayOfMonth, int hour, int minute, int second, int milliseconds)
within(long, ChronoUnit, int, Month, int, int, int, int, int)assertThat(myDate, within(1, TimeUnit.MINUTES, 2012, Months.MAY, 12, 23, 00, 01));
period - the timeunit interval the examined date should be withunit - the timeunit to define the length of the periodyear - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedmilliseconds - the millisecond of the second against which the examined date is checkedpublic static TemporalMatcher<Date> within(long period, ChronoUnit unit, int year, Month month, int dayOfMonth, int hour, int minute, int second, int milliseconds)
assertThat(myDate, within(1, TimeUnit.MINUTES, 2012, Months.MAY, 12, 23, 00, 01));
period - the timeunit interval the examined date should be withunit - the timeunit to define the length of the periodyear - the year against which the examined date is checkedmonth - the month against which the examined date is checkeddayOfMonth - the day of the month against which the examined date is checkedhour - the hour of the day against which the examined date is checkedminute - the minute of the hour against which the examined date is checkedsecond - the second of the minute against which the examined date is checkedmilliseconds - the millisecond of the second against which the examined date is checkedpublic static TemporalMatcher<Date> isYesterday()
assertThat(myDate, isToday());
public static TemporalMatcher<Date> isToday()
assertThat(myDate, isToday());
public static TemporalMatcher<Date> isTomorrow()
assertThat(myDate, isTomorrow());
public static TemporalMatcher<Date> isMonday()
assertThat(myDate, isMonday());
public static TemporalMatcher<Date> isTuesday()
assertThat(myDate, isTuesday());
public static TemporalMatcher<Date> isWednesday()
assertThat(myDate, isWednesday());
public static TemporalMatcher<Date> isThursday()
assertThat(myDate, isThursday());
public static TemporalMatcher<Date> isFriday()
assertThat(myDate, isFriday());
public static TemporalMatcher<Date> isSaturday()
assertThat(myDate, isSaturday());
public static TemporalMatcher<Date> isSunday()
assertThat(myDate, isSunday());
public static TemporalMatcher<Date> isWeekday()
assertThat(myDate, isWeekday());
public static TemporalMatcher<Date> isWeekend()
assertThat(myDate, isWeekend());
public static TemporalMatcher<Date> isFirstDayOfMonth()
assertThat(myDate, isFirstDayOfMonth());
public static TemporalMatcher<Date> isMinimum(ChronoField field)
assertThat(myDate, isMaximumDayOfMonth(ChronoField.DAY_OF_MONTH));
field - the temporal field to checkpublic static TemporalMatcher<Date> isLastDayOfMonth()
assertThat(myDate, isFirstDayOfMonth());
public static TemporalMatcher<Date> isMaximum(ChronoField field)
assertThat(myDate, isMaximum(ChronoField.DAY_OF_MONTH));
field - the temporal field to checkpublic static TemporalMatcher<Date> isMonth(Month month)
assertThat(myDate, isMonth(Month.AUGUST));
public static TemporalMatcher<Date> isJanuary()
assertThat(myDate, isJanuary());
public static TemporalMatcher<Date> isFebruary()
assertThat(myDate, isFebruary());
public static TemporalMatcher<Date> isMarch()
assertThat(myDate, isMarch());
public static TemporalMatcher<Date> isApril()
assertThat(myDate, isApril());
public static TemporalMatcher<Date> isMay()
assertThat(myDate, isMay());
public static TemporalMatcher<Date> isJune()
assertThat(myDate, isJune());
public static TemporalMatcher<Date> isJuly()
assertThat(myDate, isJuly());
public static TemporalMatcher<Date> isAugust()
assertThat(myDate, isAugust());
public static TemporalMatcher<Date> isSeptember()
assertThat(myDate, isSeptember());
public static TemporalMatcher<Date> isOctober()
assertThat(myDate, isOctober());
public static TemporalMatcher<Date> isNovember()
assertThat(myDate, isNovember());
public static TemporalMatcher<Date> isDecember()
assertThat(myDate, isDecember());
public static TemporalMatcher<Date> isLeapYear()
assertThat(myDate, isLeapYear());
Copyright © 2021 eXparity Limited. All rights reserved.