public class Dates
extends java.lang.Object
Date
s.Modifier and Type | Field and Description |
---|---|
private ComparisonStrategy |
comparisonStrategy |
(package private) Failures |
failures |
private static Dates |
INSTANCE |
Constructor and Description |
---|
Dates() |
Dates(ComparisonStrategy comparisonStrategy) |
Modifier and Type | Method and Description |
---|---|
private boolean |
actualIsBetweenGivenPeriod(AssertionInfo info,
java.util.Date actual,
java.util.Date start,
java.util.Date end,
boolean inclusiveStart,
boolean inclusiveEnd) |
private boolean |
areEqual(java.util.Date actual,
java.util.Date other)
Returns true if the actual
Date is equal to the given one according to underlying comparisonStrategy , false
otherwise. |
private static boolean |
areInSameDayOfMonth(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year, month and day of month, false otherwise.
|
private static boolean |
areInSameHour(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year, month, day of month and hour, false otherwise.
|
private static boolean |
areInSameHourWindow(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year, month and day of month, hour, minute and second, false otherwise.
|
private static boolean |
areInSameMinute(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year, month, day of month, hour and minute, false otherwise.
|
private static boolean |
areInSameMinuteWindow(java.util.Date actual,
java.util.Date other) |
private static boolean |
areInSameMonth(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year and month, false otherwise.
|
private static boolean |
areInSameSecond(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year, month and day of month, hour, minute and second, false otherwise.
|
private static boolean |
areInSameSecondWindow(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year, month and day of month, hour, minute and second, false otherwise.
|
private static boolean |
areInSameYear(java.util.Date actual,
java.util.Date other)
Returns true if both date are in the same year, false otherwise.
|
void |
assertHasDayOfMonth(AssertionInfo info,
java.util.Date actual,
int dayOfMonth)
Verifies that the actual
Date day of month is equal to the given day of month. |
void |
assertHasDayOfWeek(AssertionInfo info,
java.util.Date actual,
int dayOfWeek)
Verifies that the actual
Date day of week is equal to the given day of week. |
void |
assertHasHourOfDay(AssertionInfo info,
java.util.Date actual,
int hourOfDay)
Verifies that the actual
Date hour od day is equal to the given hour of day (24-hour clock). |
void |
assertHasMillisecond(AssertionInfo info,
java.util.Date actual,
int millisecond)
Verifies that the actual
Date millisecond is equal to the given millisecond. |
void |
assertHasMinute(AssertionInfo info,
java.util.Date actual,
int minute)
Verifies that the actual
Date minute is equal to the given minute. |
void |
assertHasMonth(AssertionInfo info,
java.util.Date actual,
int month)
Verifies that the actual
Date month is equal to the given month, month value starting at 1 (January=1,
February=2, ...). |
void |
assertHasSameTime(AssertionInfo info,
java.util.Date actual,
java.util.Date expected)
Verifies that the actual
Date has same time as the given Date . |
void |
assertHasSecond(AssertionInfo info,
java.util.Date actual,
int second)
Verifies that the actual
Date second is equal to the given second. |
void |
assertHasTime(AssertionInfo info,
java.util.Date actual,
long timestamp)
Verifies that the actual
Date time is equal to the given timestamp. |
void |
assertHasYear(AssertionInfo info,
java.util.Date actual,
int year)
Verifies that the actual
Date year is equal to the given year. |
void |
assertIsAfter(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that the actual
Date is strictly after the given one. |
void |
assertIsAfterOrEqualsTo(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that the actual
Date is after or equal to the given one. |
void |
assertIsAfterYear(AssertionInfo info,
java.util.Date actual,
int year)
Verifies that the actual
Date is strictly after the given year. |
void |
assertIsBefore(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that the actual
Date is strictly before the given one. |
void |
assertIsBeforeOrEqualsTo(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that the actual
Date is before or equal to the given one. |
void |
assertIsBeforeYear(AssertionInfo info,
java.util.Date actual,
int year)
Verifies that the actual
Date is strictly before the given year. |
void |
assertIsBetween(AssertionInfo info,
java.util.Date actual,
java.util.Date start,
java.util.Date end,
boolean inclusiveStart,
boolean inclusiveEnd)
Verifies that the actual
Date is in start:end period.start date belongs to the period if inclusiveStart is true. end date belongs to the period if inclusiveEnd is true. |
void |
assertIsCloseTo(AssertionInfo info,
java.util.Date actual,
java.util.Date other,
long deltaInMilliseconds)
Verifies that the actual
Date is close to the other date by less than delta, if difference is equals to delta it is
ok.Note that delta expressed in milliseconds. Use handy TimeUnit to convert a duration in milliseconds, for example you can express a delta of 5 seconds with TimeUnit.SECONDS.toMillis(5) . |
void |
assertIsEqualWithPrecision(AssertionInfo info,
java.util.Date actual,
java.util.Date other,
java.util.concurrent.TimeUnit precision)
Verifies that the actual
Date is equal to the given one with precision. |
void |
assertIsInSameDayAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are chronologically in the same day of month (and thus in the same month and
year). |
void |
assertIsInSameHourAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are in the same hour (and thus in the same day of month, month
and year). |
void |
assertIsInSameHourWindowAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are chronologically in the same hour, day of month, month and year. |
void |
assertIsInSameMinuteAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are in the same minute, hour, day of month, month and year. |
void |
assertIsInSameMinuteWindowAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are chronologically in the same minute. |
void |
assertIsInSameMonthAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are chronologically in the same month (and thus in the same year). |
void |
assertIsInSameSecondAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are in the same second, minute, hour, day of month, month and year. |
void |
assertIsInSameSecondWindowAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are chronologically in the same second. |
void |
assertIsInSameYearAs(AssertionInfo info,
java.util.Date actual,
java.util.Date other)
Verifies that actual and given
Date are in the same year. |
void |
assertIsInTheFuture(AssertionInfo info,
java.util.Date actual)
Verifies that the actual
Date is strictly in the future. |
void |
assertIsInThePast(AssertionInfo info,
java.util.Date actual)
Verifies that the actual
Date is strictly in the past. |
void |
assertIsNotBetween(AssertionInfo info,
java.util.Date actual,
java.util.Date start,
java.util.Date end,
boolean inclusiveStart,
boolean inclusiveEnd)
Verifies that the actual
Date is not in start:end period..start date belongs to the period if inclusiveStart is true. end date belongs to the period if inclusiveEnd is true. |
void |
assertIsToday(AssertionInfo info,
java.util.Date actual)
Verifies that the actual
Date is today, by comparing only year, month and day of actual to today (ie. |
private void |
assertNotNull(AssertionInfo info,
java.util.Date actual) |
private static void |
dateParameterIsNotNull(java.util.Date date)
used to check that the date to compare actual date to is not null, in that case throws a
NullPointerException with an
explicit message |
private static void |
endDateParameterIsNotNull(java.util.Date end)
used to check that the end of period date to compare actual date to is not null, in that case throws a
NullPointerException with an explicit message |
java.util.Comparator<?> |
getComparator() |
void |
hasSameTimeAs(AssertionInfo info,
java.util.Date actual,
java.util.Date date)
Verifies that the actual
Date is equal to the given date by comparing their time. |
static Dates |
instance()
Returns the singleton instance of this class.
|
private boolean |
isAfter(java.util.Date actual,
java.util.Date other)
Returns true if actual is after other according to underlying
comparisonStrategy , false otherwise. |
private boolean |
isAfterOrEqualTo(java.util.Date actual,
java.util.Date other)
Returns
true if the actual Date is after or equal to the given one according to underlying
comparisonStrategy , false otherwise. |
private boolean |
isBefore(java.util.Date actual,
java.util.Date other)
Returns true if actual is before other according to underlying
comparisonStrategy , false otherwise. |
private boolean |
isBeforeOrEqualTo(java.util.Date actual,
java.util.Date other)
Returns
true if the actual Date is before or equal to the given one according to underlying
comparisonStrategy , false otherwise. |
private static void |
startDateParameterIsNotNull(java.util.Date start)
used to check that the start of period date to compare actual date to is not null, in that case throws a
NullPointerException with an explicit message |
private static final Dates INSTANCE
Failures failures
private final ComparisonStrategy comparisonStrategy
Dates()
public Dates(ComparisonStrategy comparisonStrategy)
public static Dates instance()
public java.util.Comparator<?> getComparator()
public void assertIsBefore(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
is strictly before the given one.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the other date to compare actual with.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if the actual Date
is not strictly before the given one.public void assertIsBeforeOrEqualsTo(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
is before or equal to the given one.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the other date to compare actual with.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if the actual Date
is not before or equal to the given one.public void assertIsAfter(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
is strictly after the given one.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if the actual Date
is not strictly after the given one.public void assertIsAfterOrEqualsTo(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
is after or equal to the given one.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if the actual Date
is not after or equal to the given one.public void assertIsEqualWithPrecision(AssertionInfo info, java.util.Date actual, java.util.Date other, java.util.concurrent.TimeUnit precision)
Date
is equal to the given one with precision.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date.precision
- maximum precision for the comparison.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if the actual Date
is not equal to the given one.public void assertIsBetween(AssertionInfo info, java.util.Date actual, java.util.Date start, java.util.Date end, boolean inclusiveStart, boolean inclusiveEnd)
Date
is in start:end period.info
- contains information about the assertion.actual
- the "actual" Date
.start
- the period start, expected not to be null.end
- the period end, expected not to be null.inclusiveStart
- whether to include start date in period.inclusiveEnd
- whether to include end date in period.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if start Date
is null
.java.lang.NullPointerException
- if end Date
is null
.java.lang.AssertionError
- if the actual Date
is not in start:end period.private boolean actualIsBetweenGivenPeriod(AssertionInfo info, java.util.Date actual, java.util.Date start, java.util.Date end, boolean inclusiveStart, boolean inclusiveEnd)
public void assertIsNotBetween(AssertionInfo info, java.util.Date actual, java.util.Date start, java.util.Date end, boolean inclusiveStart, boolean inclusiveEnd)
Date
is not in start:end period..info
- contains information about the assertion.actual
- the "actual" Date
.start
- the period start, expected not to be null.end
- the period end, expected not to be null.inclusiveStart
- wether to include start date in period.inclusiveEnd
- wether to include end date in period.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if start Date
is null
.java.lang.NullPointerException
- if end Date
is null
.java.lang.AssertionError
- if the actual Date
is in start:end period.public void assertIsInThePast(AssertionInfo info, java.util.Date actual)
Date
is strictly in the past.info
- contains information about the assertion.actual
- the "actual" Date
.java.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
is not in the past.public void assertIsToday(AssertionInfo info, java.util.Date actual)
Date
is today, by comparing only year, month and day of actual to today (ie. we don't check
hours).info
- contains information about the assertion.actual
- the "actual" Date
.java.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
is not today.public void assertIsInTheFuture(AssertionInfo info, java.util.Date actual)
Date
is strictly in the future.info
- contains information about the assertion.actual
- the "actual" Date
.java.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
is not in the future.public void assertIsBeforeYear(AssertionInfo info, java.util.Date actual, int year)
Date
is strictly before the given year.info
- contains information about the assertion.actual
- the "actual" Date
.year
- the year to compare actual year tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
year is after or equal to the given year.public void assertIsAfterYear(AssertionInfo info, java.util.Date actual, int year)
Date
is strictly after the given year.info
- contains information about the assertion.actual
- the "actual" Date
.year
- the year to compare actual year tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
year is before or equal to the given year.public void assertHasYear(AssertionInfo info, java.util.Date actual, int year)
Date
year is equal to the given year.year
- the year to compare actual year toinfo
- contains information about the assertion.actual
- the "actual" Date
.java.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
year is not equal to the given year.public void assertHasMonth(AssertionInfo info, java.util.Date actual, int month)
Date
month is equal to the given month, month value starting at 1 (January=1,
February=2, ...).info
- contains information about the assertion.actual
- the "actual" Date
.month
- the month to compare actual month to, see Calendar.MONTH
for valid valuesjava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
month is not equal to the given month.public void assertHasDayOfMonth(AssertionInfo info, java.util.Date actual, int dayOfMonth)
Date
day of month is equal to the given day of month.info
- contains information about the assertion.actual
- the "actual" Date
.dayOfMonth
- the day of month to compare actual day of month tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
month is not equal to the given day of month.public void assertHasDayOfWeek(AssertionInfo info, java.util.Date actual, int dayOfWeek)
Date
day of week is equal to the given day of week.info
- contains information about the assertion.actual
- the "actual" Date
.dayOfWeek
- the day of week to compare actual day of week to, see Calendar.DAY_OF_WEEK
for valid valuesjava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
week is not equal to the given day of week.public void assertHasHourOfDay(AssertionInfo info, java.util.Date actual, int hourOfDay)
Date
hour od day is equal to the given hour of day (24-hour clock).info
- contains information about the assertion.actual
- the "actual" Date
.hourOfDay
- the hour of day to compare actual hour of day to (24-hour clock)java.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
hour is not equal to the given hour.public void assertHasMinute(AssertionInfo info, java.util.Date actual, int minute)
Date
minute is equal to the given minute.info
- contains information about the assertion.actual
- the "actual" Date
.minute
- the minute to compare actual minute tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
minute is not equal to the given minute.public void assertHasSecond(AssertionInfo info, java.util.Date actual, int second)
Date
second is equal to the given second.info
- contains information about the assertion.actual
- the "actual" Date
.second
- the second to compare actual second tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
second is not equal to the given second.public void assertHasMillisecond(AssertionInfo info, java.util.Date actual, int millisecond)
Date
millisecond is equal to the given millisecond.info
- contains information about the assertion.actual
- the "actual" Date
.millisecond
- the millisecond to compare actual millisecond tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
millisecond is not equal to the given millisecond.public void assertIsInSameYearAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are in the same year.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not in the same year.private static boolean areInSameYear(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullpublic void assertIsInSameMonthAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are chronologically in the same month (and thus in the same year).info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same month.private static boolean areInSameMonth(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullpublic void assertIsInSameDayAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are chronologically in the same day of month (and thus in the same month and
year).info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same day of month.private static boolean areInSameDayOfMonth(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullpublic void assertIsInSameHourAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are in the same hour (and thus in the same day of month, month
and year).info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same hour.public void assertIsInSameHourWindowAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are chronologically in the same hour, day of month, month and year.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same hour.private static boolean areInSameHourWindow(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullprivate static boolean areInSameHour(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullpublic void assertIsInSameMinuteAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are in the same minute, hour, day of month, month and year.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same minute.public void assertIsInSameMinuteWindowAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are chronologically in the same minute.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same minute.private static boolean areInSameMinute(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullprivate static boolean areInSameMinuteWindow(java.util.Date actual, java.util.Date other)
public void assertIsInSameSecondAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are in the same second, minute, hour, day of month, month and year.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same second.public void assertIsInSameSecondWindowAs(AssertionInfo info, java.util.Date actual, java.util.Date other)
Date
are chronologically in the same second.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.java.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if actual and given Date
are not chronologically speaking in the same second.private static boolean areInSameSecondWindow(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullprivate static boolean areInSameSecond(java.util.Date actual, java.util.Date other)
actual
- the actual date. expected not be nullother
- the other date. expected not be nullpublic void assertIsCloseTo(AssertionInfo info, java.util.Date actual, java.util.Date other, long deltaInMilliseconds)
Date
is close to the other date by less than delta, if difference is equals to delta it is
ok.TimeUnit.SECONDS.toMillis(5)
.info
- contains information about the assertion.actual
- the "actual" Date
.other
- the given Date
to compare actual Date
to.deltaInMilliseconds
- the delta used for date comparison, expressed in millisecondsjava.lang.AssertionError
- if actual
is null
.java.lang.NullPointerException
- if other Date
is null
.java.lang.AssertionError
- if the actual Date
week is not close to the given date by less than delta.public void assertHasTime(AssertionInfo info, java.util.Date actual, long timestamp)
Date
time is equal to the given timestamp.info
- contains information about the assertion.actual
- the "actual" Date
.timestamp
- the timestamp to compare actual time tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
time is not equal to the given timestamp.public void assertHasSameTime(AssertionInfo info, java.util.Date actual, java.util.Date expected)
Date
has same time as the given Date
.info
- contains information about the assertion.actual
- the "actual" Date
.expected
- the "expected" Date
to compare actual time tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if expected
is null
.java.lang.AssertionError
- if the actual Date
time is not equal to the given Date
.public void hasSameTimeAs(AssertionInfo info, java.util.Date actual, java.util.Date date)
Date
is equal to the given date by comparing their time.info
- contains information about the assertion.actual
- the "actual" Date
.date
- the date to compare actual time tojava.lang.AssertionError
- if actual
is null
.java.lang.AssertionError
- if the actual Date
time is not equal to the given date time.java.lang.NullPointerException
- if other Date
is null
.private static void dateParameterIsNotNull(java.util.Date date)
NullPointerException
with an
explicit messagedate
- the date to checkjava.lang.NullPointerException
- with an explicit message if the given date is nullprivate static void startDateParameterIsNotNull(java.util.Date start)
NullPointerException
with an explicit messagestart
- the start date to checkjava.lang.NullPointerException
- with an explicit message if the given start date is nullprivate static void endDateParameterIsNotNull(java.util.Date end)
NullPointerException
with an explicit messageend
- the end date to checkjava.lang.NullPointerException
- with an explicit message if the given end date is nullprivate void assertNotNull(AssertionInfo info, java.util.Date actual)
private boolean isBeforeOrEqualTo(java.util.Date actual, java.util.Date other)
true
if the actual Date
is before or equal to the given one according to underlying
comparisonStrategy
, false otherwise.actual
- the actual date - must not be null.other
- the given Date.true
if the actual Date
is before or equal to the given one according to underlying
comparisonStrategy
, false otherwise.java.lang.NullPointerException
- if actual
is null
.private boolean areEqual(java.util.Date actual, java.util.Date other)
Date
is equal to the given one according to underlying comparisonStrategy
, false
otherwise.actual
- the actual date - must not be null.other
- the given Date.true
if the actual Date
is equal to the given one according to underlying
comparisonStrategy
, false otherwise.private boolean isAfterOrEqualTo(java.util.Date actual, java.util.Date other)
true
if the actual Date
is after or equal to the given one according to underlying
comparisonStrategy
, false otherwise.actual
- the actual date - must not be null.other
- the given Date.true
if the actual Date
is after or equal to the given one according to underlying
comparisonStrategy
, false otherwise.java.lang.NullPointerException
- if actual
is null
.private boolean isBefore(java.util.Date actual, java.util.Date other)
comparisonStrategy
, false otherwise.actual
- the Date
to compare to otherother
- the Date
to compare to actualcomparisonStrategy
, false otherwise.private boolean isAfter(java.util.Date actual, java.util.Date other)
comparisonStrategy
, false otherwise.actual
- the Date
to compare to otherother
- the Date
to compare to actualcomparisonStrategy
, false otherwise.