From 114d270c9f81403bf0cdfd0adfaeb2982707d733 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Mon, 18 Sep 2017 16:39:28 -0700 Subject: [PATCH] Use date that fails with the fallback formatter Fixes gh-9975 --- .../boot/context/properties/bind/BinderTests.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java index 78893199a32..59dd57623eb 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java @@ -199,15 +199,15 @@ public class BinderTests { @Test public void bindWhenHasMalformedDateShouldThrowException() throws Exception { this.thrown.expectCause(instanceOf(ConversionFailedException.class)); - this.sources.add(new MockConfigurationPropertySource("foo", "2014-04-01")); + this.sources.add(new MockConfigurationPropertySource("foo", "2014-04-01T01:30:00.000-05:00")); this.binder.bind("foo", Bindable.of(LocalDate.class)); } @Test public void bindWhenHasAnnotationsShouldChangeConvertedValue() throws Exception { - this.sources.add(new MockConfigurationPropertySource("foo", "2014-04-01")); + this.sources.add(new MockConfigurationPropertySource("foo", "2014-04-01T01:30:00.000-05:00")); DateTimeFormat annotation = AnnotationUtils.synthesizeAnnotation( - Collections.singletonMap("iso", DateTimeFormat.ISO.DATE), + Collections.singletonMap("iso", DateTimeFormat.ISO.DATE_TIME), DateTimeFormat.class, null); LocalDate result = this.binder .bind("foo", Bindable.of(LocalDate.class).withAnnotations(annotation))