eXparity / hamcrest-date

A Java library which provides a suite hamcrest matchers for matching dates, times, and moments in time
BSD 3-Clause "New" or "Revised" License
70 stars 11 forks source link

AM/PM missing in messages #17

Closed nbraun closed 8 years ago

nbraun commented 8 years ago

Given the following assertion:

@Test
  public void testDateMatchers() throws ParseException {
    Date a = DateFormatUtils.ISO_DATETIME_FORMAT.parse("2016-02-10T03:00:00");
    Date b = DateFormatUtils.ISO_DATETIME_FORMAT.parse("2016-02-10T15:00:00");
    Assert.assertThat(b, DateMatchers.before(a));
  }

The assertion message is:

Expected: the date is after Mi, 10 Feb 2016 03:00:00.000
     but: date is Mi, 10 Feb 2016 03:00:00.000

It is not possible from the assertion message to tell that the one date is 3AM and the other is 3PM.

The current locale is de_DE Running java version 1.8.0_92 hamcrest-date 2.0.2

stewbis commented 8 years ago

Resolved in version 2.0.3