From 668f5db582fab539c4e67f2f8e1325269dbc3d5e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 5 Oct 2015 21:31:56 +0200 Subject: [PATCH] Consistent use of UTC for DateTime tests Issue: SPR-13536 --- .../format/datetime/joda/JodaTimeFormattingTests.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java b/spring-context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java index 0bc27376c29..ec63913b4e5 100644 --- a/spring-context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java +++ b/spring-context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java @@ -28,6 +28,7 @@ import org.joda.time.Instant; import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; import org.joda.time.LocalTime; +import org.joda.time.chrono.ISOChronology; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -249,7 +250,7 @@ public class JodaTimeFormattingTests { @Test public void testBindDateTime() { MutablePropertyValues propertyValues = new MutablePropertyValues(); - propertyValues.add("dateTime", new DateTime(2009, 10, 31, 12, 0)); + propertyValues.add("dateTime", new DateTime(2009, 10, 31, 12, 0, ISOChronology.getInstanceUTC())); binder.bind(propertyValues); assertEquals(0, binder.getBindingResult().getErrorCount()); String value = binder.getBindingResult().getFieldValue("dateTime").toString(); @@ -297,7 +298,7 @@ public class JodaTimeFormattingTests { @Test public void testBindDateTimeAnnotated() { MutablePropertyValues propertyValues = new MutablePropertyValues(); - propertyValues.add("dateTimeAnnotated", new DateTime(2009, 10, 31, 12, 0)); + propertyValues.add("dateTimeAnnotated", new DateTime(2009, 10, 31, 12, 0, ISOChronology.getInstanceUTC())); binder.bind(propertyValues); assertEquals(0, binder.getBindingResult().getErrorCount()); String value = binder.getBindingResult().getFieldValue("dateTimeAnnotated").toString(); @@ -316,7 +317,7 @@ public class JodaTimeFormattingTests { @Test public void testBindDateTimeAnnotatedDefault() { MutablePropertyValues propertyValues = new MutablePropertyValues(); - propertyValues.add("dateTimeAnnotatedDefault", new DateTime(2009, 10, 31, 12, 0)); + propertyValues.add("dateTimeAnnotatedDefault", new DateTime(2009, 10, 31, 12, 0, ISOChronology.getInstanceUTC())); binder.bind(propertyValues); assertEquals(0, binder.getBindingResult().getErrorCount()); String value = binder.getBindingResult().getFieldValue("dateTimeAnnotatedDefault").toString();