Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed May 21, 2024
1 parent 20dea0d commit cd33b4e
Showing 1 changed file with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -540,6 +530,7 @@ void testBindMonthDayAnnotatedPattern() {
assertThat(binder.getBindingResult().getRawFieldValue("monthDayAnnotatedPattern")).isEqualTo(MonthDay.parse("--01-03"));
}


@Nested
class FallbackPatternTests {

Expand Down Expand Up @@ -703,7 +694,6 @@ public static class DateTimeBean {

private final List<DateTimeBean> children = new ArrayList<>();


public LocalDate getLocalDate() {
return this.localDate;
}
Expand Down

0 comments on commit cd33b4e

Please sign in to comment.