@Test public void testGetJsonFormWithInvalidXmlShouldReturnEmptyJsonObject() { String json = underTest.convert("empty", NOT_USED); assertEquals(json, "{}"); }
@Override public String convert(final String xml, final String name) { String json; try { json = XML.toJSONObject(xml).toString(); } catch (JSONException e) { logger.debug("Couldn't convert to JSON the following XML: " + xml, e); json = ""; } return json; }
XmlConverter implements Converter { @Override public String convert(final String xml, final String name) { String json; try { json = XML.toJSONObject(xml).toString(); } catch (JSONException e) { logger.debug("Couldn't convert to JSON the following XML: " + xml, e); json = ""; } return json; } }
XmlConverter implements Converter { @Override public String convert(final String xml, final String name) { String json; try { json = XML.toJSONObject(xml).toString(); } catch (JSONException e) { logger.debug("Couldn't convert to JSON the following XML: " + xml, e); json = ""; } return json; }  }
XmlConverter implements Converter { @Override public String convert(final String xml, final String name) { String json; try { json = XML.toJSONObject(xml).toString(); } catch (JSONException e) { logger.debug("Couldn't convert to JSON the following XML: " + xml, e); json = ""; } return json; }  @Override String convert(final String xml, final String name); }
XmlConverter implements Converter { @Override public String convert(final String xml, final String name) { String json; try { json = XML.toJSONObject(xml).toString(); } catch (JSONException e) { logger.debug("Couldn't convert to JSON the following XML: " + xml, e); json = ""; } return json; }  @Override String convert(final String xml, final String name);  }