@Test public void parseAndRender() throws Exception { String html = "some HTML"; String syntaxId = "syntax/x.y"; HTMLCleaner cleaner = this.componentManager.getInstance(HTMLCleaner.class); when(cleaner.clean(html)).thenReturn(html); XDOM xdom = new XDOM(Collections.emptyList()); Parser xhtmlParser = this.componentManager.getInstance(Parser.class, "xhtml/1.0"); when(xhtmlParser.parse(any(StringReader.class))).thenReturn(xdom); assertEquals("", this.converter.parseAndRender(html, syntaxId)); Transformation macroTransformation = this.componentManager.getInstance(Transformation.class, "macro"); RenderingContext renderingContext = this.componentManager.getInstance(RenderingContext.class); ArgumentCaptor<TransformationContext> txContextArgument = ArgumentCaptor.forClass(TransformationContext.class); verify((MutableRenderingContext) renderingContext).transformInContext(same(macroTransformation), txContextArgument.capture(), same(xdom)); assertEquals("wysiwygtxid", txContextArgument.getValue().getId()); BlockRenderer xhtmlRenderer = this.componentManager.getInstance(BlockRenderer.class, "annotatedxhtml/1.0"); verify(xhtmlRenderer).render(same(xdom), any(WikiPrinter.class)); Syntax syntax = Syntax.valueOf(syntaxId); assertEquals(syntax, xdom.getMetaData().getMetaData(MetaData.SYNTAX)); verify(((MutableRenderingContext) renderingContext)).push(null, null, syntax, null, false, syntax); }
@Override public String parseAndRender(String dirtyHTML, String syntaxId) { return parseAndRender(dirtyHTML, getSyntax(syntaxId), null); }
DefaultHTMLConverter implements HTMLConverter { @Override public String parseAndRender(String dirtyHTML, String syntaxId) { return parseAndRender(dirtyHTML, getSyntax(syntaxId), null); } }
DefaultHTMLConverter implements HTMLConverter { @Override public String parseAndRender(String dirtyHTML, String syntaxId) { return parseAndRender(dirtyHTML, getSyntax(syntaxId), null); }  }
DefaultHTMLConverter implements HTMLConverter { @Override public String parseAndRender(String dirtyHTML, String syntaxId) { return parseAndRender(dirtyHTML, getSyntax(syntaxId), null); }  @Override String fromHTML(String dirtyHTML, String syntaxId); @Override String toHTML(String source, String syntaxId); @Override String toHTML(String source, Syntax syntax, EntityReference sourceReference); @Override String parseAndRender(String dirtyHTML, String syntaxId); @Override String parseAndRender(String dirtyHTML, Syntax syntax, EntityReference sourceReference); }
DefaultHTMLConverter implements HTMLConverter { @Override public String parseAndRender(String dirtyHTML, String syntaxId) { return parseAndRender(dirtyHTML, getSyntax(syntaxId), null); }  @Override String fromHTML(String dirtyHTML, String syntaxId); @Override String toHTML(String source, String syntaxId); @Override String toHTML(String source, Syntax syntax, EntityReference sourceReference); @Override String parseAndRender(String dirtyHTML, String syntaxId); @Override String parseAndRender(String dirtyHTML, Syntax syntax, EntityReference sourceReference);  }