@Test void testConvertJsonToMapWithInvalidJsonString() { String invalidJson = "{]"; ParsingException resultException = Assertions.assertThrows(ParsingException.class, () -> JsonUtil.convertJsonToMap(invalidJson)); String errorMessage = resultException.getCause() .getMessage(); ParsingException expectedException = new ParsingException(resultException.getCause(), Messages.CANNOT_CONVERT_JSON_STRING_TO_MAP, errorMessage, invalidJson); Assertions.assertEquals(expectedException.getMessage(), resultException.getMessage()); }
public static Map<String, Object> convertJsonToMap(InputStream json) { return convertJsonToMap(json, new TypeReference<Map<String, Object>>() { }); }
JsonUtil { public static Map<String, Object> convertJsonToMap(InputStream json) { return convertJsonToMap(json, new TypeReference<Map<String, Object>>() { }); } }
JsonUtil { public static Map<String, Object> convertJsonToMap(InputStream json) { return convertJsonToMap(json, new TypeReference<Map<String, Object>>() { }); } private  JsonUtil(); }
JsonUtil { public static Map<String, Object> convertJsonToMap(InputStream json) { return convertJsonToMap(json, new TypeReference<Map<String, Object>>() { }); } private  JsonUtil(); static Map<String, Object> convertJsonToMap(InputStream json); static Map<String, Object> convertJsonToMap(String json); static Map<K, V> convertJsonToMap(InputStream json, TypeReference<Map<K, V>> typeReference); static Map<K, V> convertJsonToMap(String json, TypeReference<Map<K, V>> typeReference); static List<Object> convertJsonToList(InputStream json); static List<Object> convertJsonToList(String json); static List<T> convertJsonToList(InputStream json, TypeReference<List<T>> typeReference); static List<T> convertJsonToList(String json, TypeReference<List<T>> typeReference); static byte[] toJsonBinary(Object object); static String toJson(Object object); static String toJson(Object object, boolean indentedOutput); static T fromJsonBinary(byte[] json, TypeReference<T> typeReference); static T fromJsonBinary(byte[] json, Class<T> classOfT); static T fromJson(String json, TypeReference<T> typeReference); static T fromJson(String json, Class<T> classOfT); static ObjectWriter getObjectWriter(boolean indentedOutput); static ObjectMapper getObjectMapper(); }
JsonUtil { public static Map<String, Object> convertJsonToMap(InputStream json) { return convertJsonToMap(json, new TypeReference<Map<String, Object>>() { }); } private  JsonUtil(); static Map<String, Object> convertJsonToMap(InputStream json); static Map<String, Object> convertJsonToMap(String json); static Map<K, V> convertJsonToMap(InputStream json, TypeReference<Map<K, V>> typeReference); static Map<K, V> convertJsonToMap(String json, TypeReference<Map<K, V>> typeReference); static List<Object> convertJsonToList(InputStream json); static List<Object> convertJsonToList(String json); static List<T> convertJsonToList(InputStream json, TypeReference<List<T>> typeReference); static List<T> convertJsonToList(String json, TypeReference<List<T>> typeReference); static byte[] toJsonBinary(Object object); static String toJson(Object object); static String toJson(Object object, boolean indentedOutput); static T fromJsonBinary(byte[] json, TypeReference<T> typeReference); static T fromJsonBinary(byte[] json, Class<T> classOfT); static T fromJson(String json, TypeReference<T> typeReference); static T fromJson(String json, Class<T> classOfT); static ObjectWriter getObjectWriter(boolean indentedOutput); static ObjectMapper getObjectMapper();  }