@Test(expected = IllegalArgumentException.class) public void testInvalidJsonGetIllegalArgument() { EventJsonParser.parseEvent("something:invald"); }
@SuppressWarnings("unchecked") public static Event parseEvent(String json) { try { return parseEventMap(objectMapper.readValue(json, HashMap.class)); } catch (IOException e) { throw new IllegalArgumentException("Cannot parse json as Event " + json, e); } }
EventJsonParser { @SuppressWarnings("unchecked") public static Event parseEvent(String json) { try { return parseEventMap(objectMapper.readValue(json, HashMap.class)); } catch (IOException e) { throw new IllegalArgumentException("Cannot parse json as Event " + json, e); } } }
EventJsonParser { @SuppressWarnings("unchecked") public static Event parseEvent(String json) { try { return parseEventMap(objectMapper.readValue(json, HashMap.class)); } catch (IOException e) { throw new IllegalArgumentException("Cannot parse json as Event " + json, e); } } private  EventJsonParser(); }
EventJsonParser { @SuppressWarnings("unchecked") public static Event parseEvent(String json) { try { return parseEventMap(objectMapper.readValue(json, HashMap.class)); } catch (IOException e) { throw new IllegalArgumentException("Cannot parse json as Event " + json, e); } } private  EventJsonParser(); @SuppressWarnings("unchecked") static Event parseEvent(String json); static String eventArrayToJson(Event[] events); @SuppressWarnings("unchecked") static Event[] parseEventArray(String json); }
EventJsonParser { @SuppressWarnings("unchecked") public static Event parseEvent(String json) { try { return parseEventMap(objectMapper.readValue(json, HashMap.class)); } catch (IOException e) { throw new IllegalArgumentException("Cannot parse json as Event " + json, e); } } private  EventJsonParser(); @SuppressWarnings("unchecked") static Event parseEvent(String json); static String eventArrayToJson(Event[] events); @SuppressWarnings("unchecked") static Event[] parseEventArray(String json);  }