Skip to content

Commit 3f4ffec

Browse files
committed
Add assertion messages to understand failures on GH CI
1 parent 7e1b41f commit 3f4ffec

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/test/java/org/apache/commons/lang3/time/DateUtilsTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,51 +1309,51 @@ void testToCalendarWithTimeZoneNull() {
13091309
@MethodSource("testToLocalDateTimeTimeZone")
13101310
void testToLocalDateTime(final LocalDateTime expected, final Date date, final TimeZone timeZone) {
13111311
assertEquals(LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()), DateUtils.toLocalDateTime(date),
1312-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1312+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13131313
}
13141314

13151315
@ParameterizedTest
13161316
@MethodSource
13171317
void testToLocalDateTimeTimeZone(final LocalDateTime expected, final Date date, final TimeZone timeZone) {
13181318
assertEquals(expected, DateUtils.toLocalDateTime(date, timeZone),
1319-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1319+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13201320
}
13211321

13221322
@ParameterizedTest
13231323
@MethodSource("testToLocalDateTimeTimeZone")
13241324
void testToOffsetDateTime(final LocalDateTime expected, final Date date, final TimeZone timeZone) {
13251325
final OffsetDateTime offsetDateTime = DateUtils.toOffsetDateTime(date);
13261326
assertEquals(OffsetDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()), offsetDateTime,
1327-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1327+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13281328
}
13291329

13301330
@ParameterizedTest
13311331
@MethodSource("testToLocalDateTimeTimeZone")
13321332
void testToOffsetDateTimeTimeZone(final LocalDateTime expected, final Date date, final TimeZone timeZone) {
13331333
assertEquals(expected, DateUtils.toOffsetDateTime(date, timeZone).toLocalDateTime(),
1334-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1334+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13351335
}
13361336

13371337
@ParameterizedTest
13381338
@MethodSource("testToLocalDateTimeTimeZone")
13391339
void testToZonedDateTime(final LocalDateTime expected, final Date date, final TimeZone timeZone) {
13401340
final ZonedDateTime zonedDateTime = DateUtils.toZonedDateTime(date);
13411341
assertEquals(ZonedDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault()), zonedDateTime,
1342-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1342+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13431343
// Using atZone()
13441344
assertEquals(date.toInstant().atZone(ZoneId.systemDefault()), zonedDateTime,
1345-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1345+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13461346
}
13471347

13481348
@ParameterizedTest
13491349
@MethodSource("testToLocalDateTimeTimeZone")
13501350
void testToZonedDateTimeTimeZone(final LocalDateTime expected, final Date date, final TimeZone timeZone) {
13511351
final ZonedDateTime zonedDateTime = DateUtils.toZonedDateTime(date, timeZone);
13521352
assertEquals(expected, zonedDateTime.toOffsetDateTime().toLocalDateTime(),
1353-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1353+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13541354
// Using atZone()
13551355
assertEquals(date.toInstant().atZone(TimeZones.toTimeZone(timeZone).toZoneId()), zonedDateTime,
1356-
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone..getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
1356+
() -> String.format("expected = %s, date = %s, timeZone = %s, TimeZone.getDefault() = %s", expected, date, timeZone, TimeZone.getDefault()));
13571357
}
13581358

13591359
/**

0 commit comments

Comments
 (0)