Polishing

This commit is contained in:
Juergen Hoeller
2024-05-21 18:24:04 +02:00
parent 20dea0dae2
commit cd33b4e35a

View File

@@ -274,9 +274,7 @@ class DateTimeFormattingTests {
binder.bind(propertyValues); binder.bind(propertyValues);
assertThat(binder.getBindingResult().getErrorCount()).isZero(); assertThat(binder.getBindingResult().getErrorCount()).isZero();
String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString();
assertThat(value) assertThat(value).startsWith("10/31/09").endsWith("12:00 PM");
.startsWith("10/31/09")
.endsWith("12:00 PM");
} }
@Test @Test
@@ -286,9 +284,7 @@ class DateTimeFormattingTests {
binder.bind(propertyValues); binder.bind(propertyValues);
assertThat(binder.getBindingResult().getErrorCount()).isZero(); assertThat(binder.getBindingResult().getErrorCount()).isZero();
String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString();
assertThat(value) assertThat(value).startsWith("10/31/09").endsWith("12:00 PM");
.startsWith("10/31/09")
.endsWith("12:00 PM");
} }
@Test @Test
@@ -298,9 +294,7 @@ class DateTimeFormattingTests {
binder.bind(propertyValues); binder.bind(propertyValues);
assertThat(binder.getBindingResult().getErrorCount()).isZero(); assertThat(binder.getBindingResult().getErrorCount()).isZero();
String value = binder.getBindingResult().getFieldValue("styleLocalDateTime").toString(); String value = binder.getBindingResult().getFieldValue("styleLocalDateTime").toString();
assertThat(value) assertThat(value).startsWith("Oct 31, 2009").endsWith("12:00:00 PM");
.startsWith("Oct 31, 2009")
.endsWith("12:00:00 PM");
} }
@Test @Test
@@ -310,9 +304,7 @@ class DateTimeFormattingTests {
binder.bind(propertyValues); binder.bind(propertyValues);
assertThat(binder.getBindingResult().getErrorCount()).isZero(); assertThat(binder.getBindingResult().getErrorCount()).isZero();
String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString();
assertThat(value) assertThat(value).startsWith("10/31/09").endsWith("12:00 PM");
.startsWith("10/31/09")
.endsWith("12:00 PM");
} }
@Test @Test
@@ -325,9 +317,7 @@ class DateTimeFormattingTests {
binder.bind(propertyValues); binder.bind(propertyValues);
assertThat(binder.getBindingResult().getErrorCount()).isZero(); assertThat(binder.getBindingResult().getErrorCount()).isZero();
String value = binder.getBindingResult().getFieldValue("localDateTime").toString(); String value = binder.getBindingResult().getFieldValue("localDateTime").toString();
assertThat(value) assertThat(value).startsWith("Oct 31, 2009").endsWith("12:00:00 PM");
.startsWith("Oct 31, 2009")
.endsWith("12:00:00 PM");
} }
@Test @Test
@@ -540,6 +530,7 @@ class DateTimeFormattingTests {
assertThat(binder.getBindingResult().getRawFieldValue("monthDayAnnotatedPattern")).isEqualTo(MonthDay.parse("--01-03")); assertThat(binder.getBindingResult().getRawFieldValue("monthDayAnnotatedPattern")).isEqualTo(MonthDay.parse("--01-03"));
} }
@Nested @Nested
class FallbackPatternTests { class FallbackPatternTests {
@@ -703,7 +694,6 @@ class DateTimeFormattingTests {
private final List<DateTimeBean> children = new ArrayList<>(); private final List<DateTimeBean> children = new ArrayList<>();
public LocalDate getLocalDate() { public LocalDate getLocalDate() {
return this.localDate; return this.localDate;
} }