JAVA-23379 Fixed test as per JDK 17 (#14484)
* JAVA-23379 Fixed test as per JDK 17 * JAVA-23379 Made SimpleDateFormat local specific
This commit is contained in:
parent
33a6f4610b
commit
17e24fc87e
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<jackson.version>2.14.2</jackson.version>
|
<jackson.version>2.14.2</jackson.version>
|
||||||
|
<java.version>17</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -3,6 +3,7 @@ package com.baeldung.jackson.objectmapper;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
@ -19,7 +20,7 @@ public class ObjectMapperBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ObjectMapperBuilder dateFormat() {
|
public ObjectMapperBuilder dateFormat() {
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm a z");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm a z", Locale.ENGLISH);
|
||||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Kolkata")));
|
simpleDateFormat.setTimeZone(TimeZone.getTimeZone(ZoneId.of("Asia/Kolkata")));
|
||||||
this.dateFormat = simpleDateFormat;
|
this.dateFormat = simpleDateFormat;
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Reference in New Issue