Consistent use of UTC for DateTime tests

Issue: SPR-13536
This commit is contained in:
Juergen Hoeller 2015-10-05 21:31:56 +02:00
parent 1b31d39b60
commit 668f5db582
1 changed files with 4 additions and 3 deletions

View File

@ -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();