Class TestUtil
java.lang.Object
com.reallifedeveloper.common.test.TestUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertEquals
(LocalDateTime expected, LocalDateTime actual, String message) Asserts that twoLocalDateTime
objects are equal "enough", rounding to milliseconds and comparing the time zone offset.static void
assertEquals
(ZonedDateTime expected, ZonedDateTime actual, String message) Asserts that twoZonedDateTime
objects are equal "enough", rounding to milliseconds and comparing the time zone offset.static String
format
(LocalDateTime localDateTime) Formats aLocalDateTime
object as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSS".static String
format
(ZonedDateTime zonedDateTime) Formats aZonedDateTime
object as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSSX".
-
Method Details
-
assertEquals
Asserts that twoLocalDateTime
objects 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 twoZonedDateTime
objects 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 aLocalDateTime
object as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSS".- Parameters:
localDateTime
- theLocalDateTime
object to format- Returns:
- the formatted string
-
format
Formats aZonedDateTime
object as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSSX".- Parameters:
zonedDateTime
- theZonedDateTime
object to format- Returns:
- the formatted string
-