From 5d91ce1fb1376aaa9e760e766fcafb3ed63cd050 Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Sat, 27 Jan 2024 14:01:00 -0500 Subject: [PATCH] Fixed error message output (spaces after commas) --- .../java/com/cedarsoftware/util/convert/MapConversions.java | 2 +- .../java/com/cedarsoftware/util/convert/ConverterTest.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/cedarsoftware/util/convert/MapConversions.java b/src/main/java/com/cedarsoftware/util/convert/MapConversions.java index c8a73c2be..09d051c04 100644 --- a/src/main/java/com/cedarsoftware/util/convert/MapConversions.java +++ b/src/main/java/com/cedarsoftware/util/convert/MapConversions.java @@ -272,7 +272,7 @@ private static T extractValue(Map map, Converter converter, ConverterO return converter.convert(map.get(VALUE), type, options); } - String keyText = ArrayUtilities.isEmpty(keys) ? "" : "[" + String.join(",", keys) + "], "; + String keyText = ArrayUtilities.isEmpty(keys) ? "" : "[" + String.join(", ", keys) + "], "; throw new IllegalArgumentException(String.format(KEY_VALUE_ERROR_MESSAGE, getShortName(type), keyText)); } diff --git a/src/test/java/com/cedarsoftware/util/convert/ConverterTest.java b/src/test/java/com/cedarsoftware/util/convert/ConverterTest.java index 50d719874..1d7847a32 100644 --- a/src/test/java/com/cedarsoftware/util/convert/ConverterTest.java +++ b/src/test/java/com/cedarsoftware/util/convert/ConverterTest.java @@ -2828,7 +2828,7 @@ void testMapToCalendar(Object value) map.clear(); assertThatThrownBy(() -> this.converter.convert(map, Calendar.class)) .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("To convert from Map to Calendar the map must include one of the following: [time,zone], [_v], or [value] with associated values"); + .hasMessageContaining("To convert from Map to Calendar the map must include one of the following: [time, zone], [_v], or [value] with associated values"); } @Test @@ -2886,7 +2886,7 @@ void testMapToGregCalendar() map.clear(); assertThatThrownBy(() -> this.converter.convert(map, GregorianCalendar.class)) .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("To convert from Map to Calendar the map must include one of the following: [time,zone], [_v], or [value] with associated values"); + .hasMessageContaining("To convert from Map to Calendar the map must include one of the following: [time, zone], [_v], or [value] with associated values"); } @Test @@ -2978,7 +2978,7 @@ void testMapToLocalDate() map.clear(); assertThatThrownBy(() -> this.converter.convert(map, LocalDate.class)) .isInstanceOf(IllegalArgumentException.class) - .hasMessageContaining("To convert from Map to LocalDate the map must include one of the following: [year,month,day], [_v], or [value] with associated values"); + .hasMessageContaining("To convert from Map to LocalDate the map must include one of the following: [year, month, day], [_v], or [value] with associated values"); } @Test