Class CommonTestUtil
java.lang.Object
com.reallifedeveloper.common.test.CommonTestUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertEquals(LocalDateTime expected, LocalDateTime actual, String message) Asserts that twoLocalDateTimeobjects are equal "enough", rounding to milliseconds and comparing the time zone offset.static voidassertEquals(ZonedDateTime expected, ZonedDateTime actual, String message) Asserts that twoZonedDateTimeobjects are equal "enough", rounding to milliseconds and comparing the time zone offset.static Stringformat(LocalDateTime localDateTime) Formats aLocalDateTimeobject as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSS".static Stringformat(ZonedDateTime zonedDateTime) Formats aZonedDateTimeobject as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSSX".
-
Method Details
-
assertEquals
Asserts that twoLocalDateTimeobjects are equal "enough", rounding to milliseconds and comparing the time zone offset.- Parameters:
expected- the expected valueactual- the actual valuemessage- the message to display if the assertion fails
-
assertEquals
Asserts that twoZonedDateTimeobjects are equal "enough", rounding to milliseconds and comparing the time zone offset.- Parameters:
expected- the expected valueactual- the actual valuemessage- the message to display if the assertion fails
-
format
Formats aLocalDateTimeobject as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSS".- Parameters:
localDateTime- theLocalDateTimeobject to format- Returns:
- the formatted string
-
format
Formats aZonedDateTimeobject as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSSX".- Parameters:
zonedDateTime- theZonedDateTimeobject to format- Returns:
- the formatted string
-