| Constructor and Description |
|---|
LocalTimeMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<LocalTime> |
after(int hour,
int minute,
int second)
Creates a matcher that matches when the examined time is after the end of the reference year
For example:
|
static org.hamcrest.Matcher<LocalTime> |
after(LocalTime time)
Creates a matcher that matches when the examined time is after the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
before(int hour,
int minute,
int second)
Creates a matcher that matches when the examined time is before the end of the reference year
For example:
|
static org.hamcrest.Matcher<LocalTime> |
before(LocalTime time)
Creates a matcher that matches when the examined time is before the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
isHour(int hour)
Creates a matcher that matches when the examined time is on the expected hour (0-23)
For example:
|
static org.hamcrest.Matcher<LocalTime> |
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 org.hamcrest.Matcher<LocalTime> |
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 org.hamcrest.Matcher<LocalTime> |
isMinute(int minute)
Creates a matcher that matches when the examined time is on the expected minute (0-59)
For example:
|
static org.hamcrest.Matcher<LocalTime> |
isSecond(int Second)
Creates a matcher that matches when the examined time is on the expected second (0-59)
For example:
|
static org.hamcrest.Matcher<LocalTime> |
sameHourOfDay(LocalTime time)
Creates a matcher that matches when the examined time is on the same hour as the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
sameMinuteOfHour(LocalTime time)
Creates a matcher that matches when the examined time is on the same minute as the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
sameOrAfter(int hour,
int minute,
int second)
Creates a matcher that matches when the examined time is on the same day or after the start of the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
sameOrAfter(LocalTime time)
Creates a matcher that matches when the examined time is at the same instant or after the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
sameOrBefore(int hour,
int minute,
int second)
Creates a matcher that matches when the examined time is on the same day or before the start of the reference
time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
sameOrBefore(LocalTime time)
Creates a matcher that matches when the examined time is at the same instant or before the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
sameSecondOfMinute(LocalTime time)
Creates a matcher that matches when the examined time is on the same second as the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
within(long period,
ChronoUnit unit,
int hour,
int minute,
int second)
Creates a matcher that matches when the examined time is within a given period of the reference time
For example:
|
static org.hamcrest.Matcher<LocalTime> |
within(long period,
ChronoUnit unit,
LocalTime time)
Creates a matcher that matches when the examined time is within a defined period the reference time
For example:
|
public static org.hamcrest.Matcher<LocalTime> after(LocalTime time)
MatcherAssert.assertThat(myTime, LocalTimeMatchers.after(LocalTime.now()));
time - the reference time against which the examined time is checkedpublic static org.hamcrest.Matcher<LocalTime> after(int hour, int minute, int second)
MatcherAssert.assertThat(myTime, LocalTimeMatchers.after(23,59,59);
hour - the hour of the dayminute - the minute of the hoursecond - the second of the minutepublic static org.hamcrest.Matcher<LocalTime> before(LocalTime time)
MatcherAssert.assertThat(myTime, LocalTimeMatchers.before(LocalTime.now()));
time - the reference time against which the examined time is checkedpublic static org.hamcrest.Matcher<LocalTime> before(int hour, int minute, int second)
MatcherAssert.assertThat(myTime, LocalTimeMatchers.before(23,59,59);
hour - the hour of the dayminute - the minute of the hoursecond - the second of the minutepublic static org.hamcrest.Matcher<LocalTime> sameOrBefore(LocalTime time)
assertThat(myTime, isSameOrBefore(LocalTime.now()))
time - the reference time against which the examined time is checkedpublic static org.hamcrest.Matcher<LocalTime> sameOrBefore(int hour, int minute, int second)
assertThat(myTime, isSameOrBefore(23, 59, 59));
hour - the hour of the dayminute - the minute of the hoursecond - the second of the minutepublic static org.hamcrest.Matcher<LocalTime> sameOrAfter(LocalTime time)
assertThat(myTime, isSameOrAfter(LocalTime.now()))
time - the reference time against which the examined time is checkedpublic static org.hamcrest.Matcher<LocalTime> sameOrAfter(int hour, int minute, int second)
assertThat(myTime, isSameOrAfter(23, 59, 59));
hour - the hour of the dayminute - the minute of the hoursecond - the second of the minutepublic static org.hamcrest.Matcher<LocalTime> within(long period, ChronoUnit unit, LocalTime time)
assertThat(myTime, within(10, TimeUnit.SECONDS, LocalTime.NOON))
time - the reference time against which the examined time is checkedpublic static org.hamcrest.Matcher<LocalTime> within(long period, ChronoUnit unit, int hour, int minute, int second)
assertThat(myTime, within(10, TimeUnit.SECONDS, 23, 59, 59));
period - the timeunit interval the examined time should be withunit - the timeunit to define the length of the periodhour - the hour of the dayminute - the minute of the hoursecond - the second of the minutepublic static org.hamcrest.Matcher<LocalTime> isMinimum(ChronoField field)
assertThat(myDate, isMaximumDayOfMonth(ChronoField.DAY_OF_MONTH));
field - the temporal field to checkpublic static org.hamcrest.Matcher<LocalTime> isMaximum(ChronoField field)
assertThat(myDate, isMaximum(ChronoField.DAY_OF_MONTH));
field - the temporal field to checkpublic static org.hamcrest.Matcher<LocalTime> isHour(int hour)
assertThat(myTime, isHour(12));
hour - the hour of the day (0-23)public static org.hamcrest.Matcher<LocalTime> sameHourOfDay(LocalTime time)
assertThat(myTime, sameHourOfDay(LocalTime.now()))
time - the reference time against which the examined time is checkedpublic static org.hamcrest.Matcher<LocalTime> isMinute(int minute)
assertThat(myTime, isMinute(12));
Minute - the minute of the day (0-59)public static org.hamcrest.Matcher<LocalTime> sameMinuteOfHour(LocalTime time)
assertThat(myTime, sameMinuteOfHour(LocalTime.now()))
time - the reference time against which the examined time is checkedpublic static org.hamcrest.Matcher<LocalTime> isSecond(int Second)
assertThat(myTime, isSecond(12));
Second - the second of the day (0-59)public static org.hamcrest.Matcher<LocalTime> sameSecondOfMinute(LocalTime time)
assertThat(myTime, sameSecondOfMinute(LocalTime.now()))
time - the reference time against which the examined time is checkedCopyright © 2016. All rights reserved.