Class ShouldBeEqualWithTimePrecision

  • All Implemented Interfaces:
    ErrorMessageFactory

    public class ShouldBeEqualWithTimePrecision
    extends BasicErrorMessageFactory
    Creates an AssertionError indicating that an assertion that verifies that two dates are equals up to a given precision failed.
    Author:
    William Delanoue, Joel Costigliola
    • Constructor Detail

      • ShouldBeEqualWithTimePrecision

        private ShouldBeEqualWithTimePrecision​(Date actual,
                                               Date expected,
                                               TimeUnit precision)
    • Method Detail

      • shouldBeEqual

        public static ErrorMessageFactory shouldBeEqual​(Date actual,
                                                        Date expected,
                                                        TimeUnit precision)
        Parameters:
        actual - the actual value in the failed assertion.
        expected - the expected value in the failed assertion.
        precision - the TimeUnit used to compare actual with expected.
        Returns:
        the created AssertionErrorFactory.
      • buildErrorMessageTemplate

        private static String buildErrorMessageTemplate​(TimeUnit precision)