Class TestUtil

java.lang.Object
com.reallifedeveloper.common.test.TestUtil

public final class TestUtil extends Object
  • Method Details

    • assertEquals

      public static void assertEquals(LocalDateTime expected, LocalDateTime actual, String message)
      Asserts that two LocalDateTime objects are equal "enough", rounding to milliseconds and comparing the time zone offset.
      Parameters:
      expected - the expected value
      actual - the actual value
      message - the message to display if the assertion fails
    • assertEquals

      public static void assertEquals(ZonedDateTime expected, ZonedDateTime actual, String message)
      Asserts that two ZonedDateTime objects are equal "enough", rounding to milliseconds and comparing the time zone offset.
      Parameters:
      expected - the expected value
      actual - the actual value
      message - the message to display if the assertion fails
    • format

      public static String format(LocalDateTime localDateTime)
      Formats a LocalDateTime object as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSS".
      Parameters:
      localDateTime - the LocalDateTime object to format
      Returns:
      the formatted string
    • format

      public static String format(ZonedDateTime zonedDateTime)
      Formats a ZonedDateTime object as a string using the pattern "yyyy-MM-dd\'T\'HH:mm:ss.SSSX".
      Parameters:
      zonedDateTime - the ZonedDateTime object to format
      Returns:
      the formatted string