diff --git a/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java b/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java index cffdb185a986..a2130906a5c2 100644 --- a/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java +++ b/spring-context/src/test/java/org/springframework/format/datetime/standard/DateTimeFormattingTests.java @@ -274,9 +274,7 @@ void testBindLocalDateTime() { binder.bind(propertyValues); assertThat(binder.getBindingResult().getErrorCount()).isZero(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); - assertThat(value) - .startsWith("10/31/09") - .endsWith("12:00 PM"); + assertThat(value).startsWith("10/31/09").endsWith("12:00 PM"); } @Test @@ -286,9 +284,7 @@ void testBindLocalDateTimeWithISO() { binder.bind(propertyValues); assertThat(binder.getBindingResult().getErrorCount()).isZero(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); - assertThat(value) - .startsWith("10/31/09") - .endsWith("12:00 PM"); + assertThat(value).startsWith("10/31/09").endsWith("12:00 PM"); } @Test @@ -298,9 +294,7 @@ void testBindLocalDateTimeAnnotated() { binder.bind(propertyValues); assertThat(binder.getBindingResult().getErrorCount()).isZero(); String value = binder.getBindingResult().getFieldValue("styleLocalDateTime").toString(); - assertThat(value) - .startsWith("Oct 31, 2009") - .endsWith("12:00:00 PM"); + assertThat(value).startsWith("Oct 31, 2009").endsWith("12:00:00 PM"); } @Test @@ -310,9 +304,7 @@ void testBindLocalDateTimeFromJavaUtilCalendar() { binder.bind(propertyValues); assertThat(binder.getBindingResult().getErrorCount()).isZero(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); - assertThat(value) - .startsWith("10/31/09") - .endsWith("12:00 PM"); + assertThat(value).startsWith("10/31/09").endsWith("12:00 PM"); } @Test @@ -325,9 +317,7 @@ void testBindDateTimeWithSpecificStyle() { binder.bind(propertyValues); assertThat(binder.getBindingResult().getErrorCount()).isZero(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); - assertThat(value) - .startsWith("Oct 31, 2009") - .endsWith("12:00:00 PM"); + assertThat(value).startsWith("Oct 31, 2009").endsWith("12:00:00 PM"); } @Test @@ -540,6 +530,7 @@ void testBindMonthDayAnnotatedPattern() { assertThat(binder.getBindingResult().getRawFieldValue("monthDayAnnotatedPattern")).isEqualTo(MonthDay.parse("--01-03")); } + @Nested class FallbackPatternTests { @@ -703,7 +694,6 @@ public static class DateTimeBean { private final List children = new ArrayList<>(); - public LocalDate getLocalDate() { return this.localDate; }