Consistent use of UTC for DateTime tests
Issue: SPR-13536
This commit is contained in:
parent
1b31d39b60
commit
668f5db582
|
|
@ -28,6 +28,7 @@ import org.joda.time.Instant;
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
import org.joda.time.LocalDateTime;
|
import org.joda.time.LocalDateTime;
|
||||||
import org.joda.time.LocalTime;
|
import org.joda.time.LocalTime;
|
||||||
|
import org.joda.time.chrono.ISOChronology;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
@ -249,7 +250,7 @@ public class JodaTimeFormattingTests {
|
||||||
@Test
|
@Test
|
||||||
public void testBindDateTime() {
|
public void testBindDateTime() {
|
||||||
MutablePropertyValues propertyValues = new MutablePropertyValues();
|
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);
|
binder.bind(propertyValues);
|
||||||
assertEquals(0, binder.getBindingResult().getErrorCount());
|
assertEquals(0, binder.getBindingResult().getErrorCount());
|
||||||
String value = binder.getBindingResult().getFieldValue("dateTime").toString();
|
String value = binder.getBindingResult().getFieldValue("dateTime").toString();
|
||||||
|
|
@ -297,7 +298,7 @@ public class JodaTimeFormattingTests {
|
||||||
@Test
|
@Test
|
||||||
public void testBindDateTimeAnnotated() {
|
public void testBindDateTimeAnnotated() {
|
||||||
MutablePropertyValues propertyValues = new MutablePropertyValues();
|
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);
|
binder.bind(propertyValues);
|
||||||
assertEquals(0, binder.getBindingResult().getErrorCount());
|
assertEquals(0, binder.getBindingResult().getErrorCount());
|
||||||
String value = binder.getBindingResult().getFieldValue("dateTimeAnnotated").toString();
|
String value = binder.getBindingResult().getFieldValue("dateTimeAnnotated").toString();
|
||||||
|
|
@ -316,7 +317,7 @@ public class JodaTimeFormattingTests {
|
||||||
@Test
|
@Test
|
||||||
public void testBindDateTimeAnnotatedDefault() {
|
public void testBindDateTimeAnnotatedDefault() {
|
||||||
MutablePropertyValues propertyValues = new MutablePropertyValues();
|
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);
|
binder.bind(propertyValues);
|
||||||
assertEquals(0, binder.getBindingResult().getErrorCount());
|
assertEquals(0, binder.getBindingResult().getErrorCount());
|
||||||
String value = binder.getBindingResult().getFieldValue("dateTimeAnnotatedDefault").toString();
|
String value = binder.getBindingResult().getFieldValue("dateTimeAnnotatedDefault").toString();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue