VisualizationFacadeEjb implements VisualizationFacade { static String extractJson(String html, Language language) { final Parser parser = Parser.htmlParser(); final Document doc = parser.parseInput(html, ""); Element jsonScripElement = doc.select("script[type='application/json']").first(); String json = jsonScripElement.html(); json = doI18n(json, language); return json; }  @Override String buildTransmissionChainJson(
		Date fromDate,
		Date toDate,
		RegionReferenceDto region,
		DistrictReferenceDto district,
		Collection<Disease> diseases,
		Language language); @Override Long getContactCount(Date fromDate, Date toDate, RegionReferenceDto region, DistrictReferenceDto district, Collection<Disease> diseases);  }
@Test public void testExtractJson() { String json = VisualizationFacadeEjb.extractJson( "<!DOCTYPE html>\r\n" + "<html>\r\n" + "<head>\r\n" + "<meta charset=\"utf-8\"/>\r\n" + "<style>body{background-color:white;}</style>\r\n" + "<script src=\"result_files/htmlwidgets-1.5.1/htmlwidgets.js\"></script>\r\n" + "<link href=\"result_files/vis-4.20.1/vis.css\" rel=\"stylesheet\" />\r\n" + "</head>\r\n" + "<body>\r\n" + "<div id=\"htmlwidget_container\">\r\n" + " <div id=\"htmlwidget-b9f896960aa32dc1f3e5\" style=\"width:90%;height:700px;\" class=\"visNetwork html-widget\"></div>\r\n" + "</div>\r\n" + "<script type=\"application/json\" data-for=\"htmlwidget-b9f896960aa32dc1f3e5\">{\"x\":\"a\\/b\"}</script>\r\n" + "</body>\r\n" + "</html>", Language.EN); assertThat(json, is("{\"x\":\"a\\/b\"}")); }