Skip to content

Commit b412e1d

Browse files
committed
Add a test work-around for odd seeming incompatiblity b/w JDK 8, JDK 11, wrt "short representation" DateTime format
1 parent 674de4d commit b412e1d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/java/com/fasterxml/jackson/datatype/joda/DateTimeTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,13 @@ public void testAsTextNoMilliseconds() throws Exception
123123
public void testCustomPatternStyle() throws IOException
124124
{
125125
// or, using annotations
126-
assertEquals(aposToQuotes("{'date':'1/1/70 12:00 AM'}"),
127-
STRING_MAPPER.writeValueAsString(new CustomDate(DATE_JAN_1_1970_UTC)));
126+
// 05-May-2019, tatu: Looks like "short representation" somehow varies between JDK 8 and JDK 11?
127+
// JDK 11 adding an extra comma. No idea how, why but... need to work around
128+
String json = STRING_MAPPER.writeValueAsString(new CustomDate(DATE_JAN_1_1970_UTC));
129+
if (json.contains(",")) {
130+
json = json.replace(", ", " ");
131+
}
132+
assertEquals(aposToQuotes("{'date':'1/1/70 12:00 AM'}"), json);
128133
}
129134

130135
public void testSerializationWithTypeInfo() throws IOException

0 commit comments

Comments
 (0)