From bc68eeb9154874ef8135d65317619a197eeb0ceb Mon Sep 17 00:00:00 2001 From: Vladimir Petko Date: Wed, 17 Jan 2024 15:48:35 +1300 Subject: [PATCH] Replace the special character with a space See https://bugs.openjdk.org/browse/JDK-8284840. For the assertion to succeed, special character is replaced by a normal space. --- .../com/fasterxml/jackson/datatype/joda/DateTimeTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/test/java/com/fasterxml/jackson/datatype/joda/DateTimeTest.java b/src/test/java/com/fasterxml/jackson/datatype/joda/DateTimeTest.java index 4d3d7669..b9324aa1 100644 --- a/src/test/java/com/fasterxml/jackson/datatype/joda/DateTimeTest.java +++ b/src/test/java/com/fasterxml/jackson/datatype/joda/DateTimeTest.java @@ -129,6 +129,12 @@ public void testCustomPatternStyle() throws IOException if (json.contains(",")) { json = json.replace(", ", " "); } + // https://bugs.openjdk.org/browse/JDK-8284840 + // Java 21 uses NBSP/NNBSP prefixed to AM/PM in time format, instead of a normal space + if (json.contains("\u202f")) { + json = json.replace("\u202f", " "); + } + assertEquals(aposToQuotes("{'date':'1/1/70 12:00 AM'}"), json); }