### Question:
JsonToHtmlPrettyPrintingRenderer implements WebHookStringRenderer { @Override public String render(String uglyJSONString) throws WebHookHtmlRendererException { JsonElement je; try { je = jp.parse(uglyJSONString); return "<pre><code class=\"json\">" + htmlr.render(gson.toJson(je) .replaceAll("\\\\u003c", "<") .replaceAll("\\\\u003e", ">") .replaceAll("\\\\u0026", "&") .replaceAll("\\\\u003d", "=")) + "</code></pre>"; } catch (Exception e){ throw new WebHookHtmlRendererException(e); } }  @Override String render(String uglyJSONString); @Override String render(Map<String, String[]> input);  }### Answer:
@Test public void testRender() throws WebHookHtmlRendererException { JsonToHtmlPrettyPrintingRenderer j = new JsonToHtmlPrettyPrintingRenderer(); exception.expect(WebHookHtmlRendererException.class); j.render("{sdldsfj {]}"); }
@Test public void testRenderWithOutput() { try { JsonToHtmlPrettyPrintingRenderer j = new JsonToHtmlPrettyPrintingRenderer(); j.render("{sdldsfj {]}"); } catch (WebHookHtmlRendererException ex){ System.out.println(ex.getMessage()); } }
@Test public void testRender2WithOutput() { try { JsonToHtmlPrettyPrintingRenderer j = new JsonToHtmlPrettyPrintingRenderer(); System.out.println( j.render("{ \"text\": \"All your build failures are belong to us\", \"attachments\": [ " + "{ \"fallback\": \"${buildName} <${buildStatusUrl}|build #${buildNumber}> " + "triggered by ${triggeredBy} has a status of ${buildResult}\", " + "\"text\": \"${buildName} <${buildStatusUrl}|build #${buildNumber}> " + "triggered by ${triggeredBy} has a status of ${buildResult}\", \"color\": \"danger\" }]}") ); } catch (WebHookHtmlRendererException ex){ System.out.println(ex.getMessage()); } }