public abstract class DateMatchers extends Object
Matcher instances for comparing dates| Constructor and Description |
|---|
DateMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static DateMatcher<Date> |
after(Date date)
Creates a matcher that matches when the examined date is after the reference date
For example:
|
static DateMatcher<Date> |
after(DayMonthYear date)
Deprecated.
Use
after(LocalDate) |
static DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
after(int year,
Months month,
int day)
Deprecated.
|
static DateMatcher<Date> |
after(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static DateMatcher<Date> |
after(LocalDate date)
Creates a matcher that matches when the examined date is after the reference date
For example:
|
static DateMatcher<Date> |
before(Date date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static DateMatcher<Date> |
before(DayMonthYear date)
Deprecated.
|
static DateMatcher<Date> |
before(int year,
Month month,
int dayOfMonth)
Creates a matcher that matches when the examined date is before the start of reference day
For example:
|
static DateMatcher<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 start of the reference date and time
For example:
|
static DateMatcher<Date> |
before(int year,
Months month,
int dayOfMonth)
Deprecated.
|
static DateMatcher<Date> |
before(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static DateMatcher<Date> |
before(LocalDate date)
Creates a matcher that matches when the examined date is before the reference date
For example:
|
static DateMatcher<Date> |
isApril()
Creates a matcher that matches when the examined date is in April
For example:
|
static DateMatcher<Date> |
isAugust()
Creates a matcher that matches when the examined date is in August
For example:
|
static DateMatcher<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 DateMatcher<Date> |
isDayOfMonth(int dayOfMonth)
Creates a matcher that matches when the examined date is on the expected day of the month
For example:
|
static DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
isDayOfWeek(Weekdays dayOfWeek)
Deprecated.
|
static DateMatcher<Date> |
isDecember()
Creates a matcher that matches when the examined date is in December
For example:
|
static DateMatcher<Date> |
isFebruary()
Creates a matcher that matches when the examined date is in February
For example:
|
static DateMatcher<Date> |
isFirstDayOfMonth()
Creates a matcher that matches when the examined date is on the first day of the month
For example:
|
static DateMatcher<Date> |
isFriday()
Creates a matcher that matches when the examined date is on a friday
For example:
|
static DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
isJanuary()
Creates a matcher that matches when the examined date is in January
For example:
|
static DateMatcher<Date> |
isJuly()
Creates a matcher that matches when the examined date is in July
For example:
|
static DateMatcher<Date> |
isJune()
Creates a matcher that matches when the examined date is in June
For example:
|
static DateMatcher<Date> |
isLastDayOfMonth()
Creates a matcher that matches when the examined date is on the first day of the month
For example:
|
static DateMatcher<Date> |
isLeapYear()
Creates a matcher that matches when the examined date is a leap year
For example:
|
static DateMatcher<Date> |
isMarch()
Creates a matcher that matches when the examined date is in March
For example:
|
static DateMatcher<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 DateMatcher<Date> |
isMay()
Creates a matcher that matches when the examined date is in May
For example:
|
static DateMatcher<Date> |
isMillisecond(int millisecond)
Creates a matcher that matches when the examined date is on the reference second
For example:
|
static DateMatcher<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 DateMatcher<Date> |
isMinute(int minute)
Creates a matcher that matches when the examined date is on the reference minute
For example:
|
static DateMatcher<Date> |
isMonday()
Creates a matcher that matches when the examined date is on a monday
For example:
|
static DateMatcher<Date> |
isMonth(Month month)
Creates a matcher that matches when the examined date is in the expected month
For example:
|
static DateMatcher<Date> |
isNovember()
Creates a matcher that matches when the examined date is in November
For example:
|
static DateMatcher<Date> |
isOctober()
Creates a matcher that matches when the examined date is in October
For example:
|
static DateMatcher<Date> |
isSaturday()
Creates a matcher that matches when the examined date is on a saturday
For example:
|
static DateMatcher<Date> |
isSecond(int second)
Creates a matcher that matches when the examined date is on the reference second
For example:
|
static DateMatcher<Date> |
isSeptember()
Creates a matcher that matches when the examined date is in September
For example:
|
static DateMatcher<Date> |
isSunday()
Creates a matcher that matches when the examined date is on a sunday
For example:
|
static DateMatcher<Date> |
isThursday()
Creates a matcher that matches when the examined date is on a thursday
For example:
|
static DateMatcher<Date> |
isToday()
Creates a matcher that matches when the examined date is today
For example:
|
static DateMatcher<Date> |
isTomorrow()
Creates a matcher that matches when the examined date is tomorrow
For example:
|
static DateMatcher<Date> |
isTuesday()
Creates a matcher that matches when the examined date is on a tuesday
For example:
|
static DateMatcher<Date> |
isWednesday()
Creates a matcher that matches when the examined date is on a wednesday
For example:
|
static DateMatcher<Date> |
isWeekday()
Creates a matcher that matches when the examined date is on a weekday
For example:
|
static DateMatcher<Date> |
isWeekend()
Creates a matcher that matches when the examined date is on a weekend
For example:
|
static DateMatcher<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 DateMatcher<Date> |
isYesterday()
Creates a matcher that matches when the examined date is yesterday
For example:
|
static DateMatcher<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 DateMatcher<Date> |
sameDay(DayMonthYear date)
Deprecated.
|
static DateMatcher<Date> |
sameDay(int year,
Months month,
int day)
Deprecated.
|
static DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
sameHour(Date date)
Deprecated.
Use
sameHourOfDay(Date) instead |
static DateMatcher<Date> |
sameHour(int hour)
Deprecated.
Use
isHour(int) instead |
static DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
sameInstant(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second,
int milliseconds)
Deprecated.
|
static DateMatcher<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 DateMatcher<Date> |
sameMillisecond(Date date)
Deprecated.
Use
sameMillisecondOfSecond(Date) instead |
static DateMatcher<Date> |
sameMillisecond(int millisecond)
Deprecated.
Use
isMillisecond(int) instead |
static DateMatcher<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 DateMatcher<Date> |
sameMinute(Date date)
Deprecated.
Use
sameMinuteOfHour(Date) instead |
static DateMatcher<Date> |
sameMinute(int minute)
Deprecated.
Use
isMinute(int) instead |
static DateMatcher<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 DateMatcher<Date> |
sameMonth(Date date)
Deprecated.
Use
sameMonthOfYear(Date) instead |
static DateMatcher<Date> |
sameMonth(Months month)
Deprecated.
Use
sameMonthOfYear(Months) instead |
static DateMatcher<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 DateMatcher<Date> |
sameMonthOfYear(Months month)
Deprecated.
Use
isMonth(Month) |
static DateMatcher<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 DateMatcher<Date> |
sameOrAfter(DayMonthYear date)
Deprecated.
|
static DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
sameOrAfter(int year,
Months month,
int dayOfMonth)
Deprecated.
Use {@link #sameOrAfter(int, Month, int)
|
static DateMatcher<Date> |
sameOrAfter(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
sameOrBefore(DayMonthYear date)
Deprecated.
|
static DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
sameOrBefore(int year,
Months month,
int dayOfMonth)
Deprecated.
|
static DateMatcher<Date> |
sameOrBefore(int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second)
Deprecated.
|
static DateMatcher<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 DateMatcher<Date> |
sameSecond(Date date)
Deprecated.
Use
sameSecondOfMinute(Date) instead |
static DateMatcher<Date> |
sameSecond(int second)
Deprecated.
Use
isSecond(int) instead |
static DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<Date> |
within(long period,
TimeUnit unit,
Date date)
Deprecated.
|
static DateMatcher<Date> |
within(long period,
TimeUnit unit,
DayMonthYear date)
Deprecated.
|
static DateMatcher<Date> |
within(long period,
TimeUnit unit,
int year,
Months month,
int dayOfMonth)
Deprecated.
|
static DateMatcher<Date> |
within(long period,
TimeUnit unit,
int year,
Months month,
int dayOfMonth,
int hour,
int minute,
int second,
int milliseconds)
Deprecated.
|
public static DateMatcher<Date> after(Date date)
assertThat(myDate, after(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> after(DayMonthYear date)
after(LocalDate)assertThat(myDate, after(Moments.today()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> after(LocalDate date)
assertThat(myDate, after(Moments.today()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<Date> before(Date date)
assertThat(myDate, before(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> before(LocalDate date)
assertThat(myDate, before(LocalDate.now()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> before(DayMonthYear date)
before(LocalDate)assertThat(myDate, before(Moments.today()));
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> before(int year, Months month, int dayOfMonth)
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 checkeddayOfMonth - the day of the month against which the examined date is checkedpublic static DateMatcher<Date> before(int year, Month month, int dayOfMonth)
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 checkeddayOfMonth - the day of the month against which the examined date is checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<Date> sameDayOfWeek(Date date)
assertThat(myDate, sameWeekday(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> isDayOfWeek(Weekdays dayOfWeek)
isDayOfWeek(DayOfWeek...)assertThat(myDate, isDayOfWeek(Weekdays.MONDAY))
dayOfWeek - the reference weekday against which the examined date is checkedpublic static DateMatcher<Date> isDayOfWeek(DayOfWeek dayOfWeek)
assertThat(myDate, isDayOfWeek(DayOfWeek.MONDAY))
dayOfWeek - the reference weekday against which the examined date is checkedpublic static DateMatcher<Date> isDayOfWeek(DayOfWeek... daysOfWeek)
assertThat(myDate, isDayOfWeek(DayOfWeek.MONDAY, DayOfWeek.TUESDAY))
daysOfWeek - the reference weekdays against which the examined date is checkedpublic static DateMatcher<Date> sameDayOfMonth(Date date)
assertThat(myDate, sameDayOfMonth(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> isDayOfMonth(int dayOfMonth)
assertThat(myDate, isDayOfMonth(4))
dayOfMonth - the expected day of the monthpublic static DateMatcher<Date> sameDay(Date date)
assertThat(myDate, sameDay(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> sameDay(DayMonthYear date)
sameDay(LocalDate)assertThat(myDate, sameDay(Moments.today()));
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameDay(LocalDate date)
assertThat(myDate, sameDay(Moments.today()));
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<Date> sameHour(Date date)
sameHourOfDay(Date) insteadassertThat(myDate, sameHour(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameHourOfDay(Date date)
assertThat(myDate, sameHourOfDay(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> sameHour(int hour)
isHour(int) insteadassertThat(myDate, sameHour(12));
hour - the reference hour against which the examined date is checkedpublic static DateMatcher<Date> isHour(int hour)
assertThat(myDate, sameHour(12));
hour - the reference hour against which the examined date is checkedpublic static DateMatcher<Date> sameInstant(Date date)
assertThat(myDate, sameInstant(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameInstant(long timestamp)
assertThat(myDate, sameInstant(1325415600000L))
timestamp - the time as milliseconds since the Unix epoch time@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<Date> sameOrBefore(Date date)
assertThat(myDate, sameOrBefore(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameOrBefore(LocalDate date)
assertThat(myDate, sameOrBefore(LocalDate.now()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<Date> sameOrAfter(Date date)
assertThat(myDate, sameOrAfter(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameOrAfter(LocalDate date)
assertThat(myDate, sameOrAfter(LocalDate.now()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<Date> sameMinute(Date date)
sameMinuteOfHour(Date) insteadassertThat(myDate, sameMinute(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameMinuteOfHour(Date date)
assertThat(myDate, sameMinute(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> sameMinute(int minute)
isMinute(int) insteadassertThat(myDate, sameMinute(55))
minute - the reference minute against which the examined date is checkedpublic static DateMatcher<Date> isMinute(int minute)
assertThat(myDate, sameMinute(55))
minute - the reference minute against which the examined date is checked@Deprecated public static DateMatcher<Date> sameMonth(Date date)
sameMonthOfYear(Date) insteadassertThat(myDate, sameMonth(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameMonthOfYear(Date date)
assertThat(myDate, sameMonth(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<Date> sameSecond(Date date)
sameSecondOfMinute(Date) insteadassertThat(myDate, sameSecond(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameSecondOfMinute(Date date)
assertThat(myDate, sameSecond(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> sameSecond(int second)
isSecond(int) insteadassertThat(myDate, sameSecond(33))
second - the reference date against which the examined date is checkedpublic static DateMatcher<Date> isSecond(int second)
assertThat(myDate, sameSecond(33))
second - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> sameMillisecond(Date date)
sameMillisecondOfSecond(Date) insteadassertThat(myDate, sameMillisecond(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> sameMillisecondOfSecond(Date date)
assertThat(myDate, sameMillisecond(new Date()))
date - the reference date against which the examined date is checked@Deprecated public static DateMatcher<Date> sameMillisecond(int millisecond)
isMillisecond(int) insteadassertThat(myDate, sameMillisecond(123))
millisecond - the millisecond against which the examined date is checkedpublic static DateMatcher<Date> isMillisecond(int millisecond)
assertThat(myDate, sameMillisecond(123))
millisecond - the millisecond against which the examined date is checkedpublic static DateMatcher<Date> sameYear(Date date)
assertThat(myDate, sameYear(new Date()))
date - the reference date against which the examined date is checkedpublic static DateMatcher<Date> isYear(int year)
assertThat(myDate, sameYear(2013))
year - the reference year against which the examined date is checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<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 checked@Deprecated public static DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<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 DateMatcher<Date> isYesterday()
assertThat(myDate, isToday());
public static DateMatcher<Date> isToday()
assertThat(myDate, isToday());
public static DateMatcher<Date> isTomorrow()
assertThat(myDate, isTomorrow());
public static DateMatcher<Date> isMonday()
assertThat(myDate, isMonday());
public static DateMatcher<Date> isTuesday()
assertThat(myDate, isTuesday());
public static DateMatcher<Date> isWednesday()
assertThat(myDate, isWednesday());
public static DateMatcher<Date> isThursday()
assertThat(myDate, isThursday());
public static DateMatcher<Date> isFriday()
assertThat(myDate, isFriday());
public static DateMatcher<Date> isSaturday()
assertThat(myDate, isSaturday());
public static DateMatcher<Date> isSunday()
assertThat(myDate, isSunday());
public static DateMatcher<Date> isWeekday()
assertThat(myDate, isWeekday());
public static DateMatcher<Date> isWeekend()
assertThat(myDate, isWeekend());
public static DateMatcher<Date> isFirstDayOfMonth()
assertThat(myDate, isFirstDayOfMonth());
public static DateMatcher<Date> isMinimum(ChronoField field)
assertThat(myDate, isMaximumDayOfMonth(ChronoField.DAY_OF_MONTH));
field - the temporal field to checkpublic static DateMatcher<Date> isLastDayOfMonth()
assertThat(myDate, isFirstDayOfMonth());
public static DateMatcher<Date> isMaximum(ChronoField field)
assertThat(myDate, isMaximum(ChronoField.DAY_OF_MONTH));
field - the temporal field to checkpublic static DateMatcher<Date> isMonth(Month month)
assertThat(myDate, isMonth(Month.AUGUST));
public static DateMatcher<Date> isJanuary()
assertThat(myDate, isJanuary());
public static DateMatcher<Date> isFebruary()
assertThat(myDate, isFebruary());
public static DateMatcher<Date> isMarch()
assertThat(myDate, isMarch());
public static DateMatcher<Date> isApril()
assertThat(myDate, isApril());
public static DateMatcher<Date> isMay()
assertThat(myDate, isMay());
public static DateMatcher<Date> isJune()
assertThat(myDate, isJune());
public static DateMatcher<Date> isJuly()
assertThat(myDate, isJuly());
public static DateMatcher<Date> isAugust()
assertThat(myDate, isAugust());
public static DateMatcher<Date> isSeptember()
assertThat(myDate, isSeptember());
public static DateMatcher<Date> isOctober()
assertThat(myDate, isOctober());
public static DateMatcher<Date> isNovember()
assertThat(myDate, isNovember());
public static DateMatcher<Date> isDecember()
assertThat(myDate, isDecember());
public static DateMatcher<Date> isLeapYear()
assertThat(myDate, isLeapYear());
Copyright © 2019. All rights reserved.