-
Notifications
You must be signed in to change notification settings - Fork 81
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
4 changed files
with
57 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
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
25 changes: 25 additions & 0 deletions
25
...est/java/tools/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,25 @@ | ||
package tools.jackson.datatype.joda.failing; | ||
|
||
import tools.jackson.databind.ObjectMapper; | ||
import tools.jackson.databind.SerializationFeature; | ||
|
||
import tools.jackson.datatype.joda.JodaTestBase; | ||
|
||
import org.joda.time.*; | ||
|
||
// [datatype-joda#146]: disable overwriting of timezone | ||
public class DateTimeSerializationWithOffsets146Test extends JodaTestBase | ||
{ | ||
// [datatype-joda#146] | ||
public void testDateTimeSerializationWithOffsets146() 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