Skip to content

Commit bd29695

Browse files
committed
backport JDK 11 test fix in 2.10
1 parent 2610020 commit bd29695

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,15 @@ 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
}
129-
134+
130135
public void testSerializationWithTypeInfo() throws IOException
131136
{
132137
// let's use epoch time (Jan 1, 1970, UTC)

0 commit comments

Comments
 (0)