-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
.../com/fasterxml/jackson/datatype/joda/failing/DateTimeSerializationWithOffsets146Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.fasterxml.jackson.datatype.joda.failing; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.SerializationFeature; | ||
|
||
import com.fasterxml.jackson.datatype.joda.JodaTestBase; | ||
|
||
import org.joda.time.*; | ||
|
||
// [datatype-joda#146]: disable overwriting of timezone | ||
public class DateTimeSerializationWithOffsets146Test extends JodaTestBase | ||
{ | ||
private final ObjectMapper MAPPER = jodaMapper(); | ||
{ | ||
MAPPER.enable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); | ||
MAPPER.enable(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS); | ||
} | ||
|
||
// [datatype-joda#146] | ||
public void testLocalDateSer() throws Exception | ||
{ | ||
final ObjectMapper MAPPER = mapperWithModuleBuilder() | ||
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) | ||
.disable(SerializationFeature.WRITE_DATES_WITH_CONTEXT_TIME_ZONE) | ||
.build(); | ||
final String inputStr = "2024-12-01T00:00:00+02:00"; | ||
|
||
DateTime dateTime = DateTime.parse(inputStr); | ||
assertEquals(q(inputStr), MAPPER.writeValueAsString(dateTime)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters