@Test public void getContentUsesAnotherBlockRenderer() throws Exception { ExpandedMacroBlock expandedMacroBlock = new ExpandedMacroBlock("gallery", Collections.<String, String>emptyMap(), this.contentRenderer, false, this.componentManager); XDOM parent = new XDOM(Collections.singletonList(expandedMacroBlock)); parent.getMetaData().addMetaData(MetaData.SYNTAX, Syntax.MARKDOWN_1_1); BlockRenderer markdownRenderer = mock(BlockRenderer.class); when(this.componentManager.hasComponent(BlockRenderer.class, Syntax.MARKDOWN_1_1.toIdString())) .thenReturn(true); when(this.componentManager.getInstance(BlockRenderer.class, Syntax.MARKDOWN_1_1.toIdString())) .thenReturn(markdownRenderer); expandedMacroBlock.getContent(); verify(markdownRenderer).render(any(XDOM.class), any(WikiPrinter.class)); verify(this.contentRenderer, never()).render(any(XDOM.class), any(WikiPrinter.class)); }
@Override public String getContent() { WikiPrinter printer = new DefaultWikiPrinter(); XDOM xdom; if (getChildren().size() == 1 && getChildren().get(0) instanceof XDOM) { xdom = (XDOM) getChildren().get(0); } else { xdom = new XDOM(getChildren()); } getContentRenderer().render(xdom, printer); return printer.toString(); }
ExpandedMacroBlock extends MacroBlock { @Override public String getContent() { WikiPrinter printer = new DefaultWikiPrinter(); XDOM xdom; if (getChildren().size() == 1 && getChildren().get(0) instanceof XDOM) { xdom = (XDOM) getChildren().get(0); } else { xdom = new XDOM(getChildren()); } getContentRenderer().render(xdom, printer); return printer.toString(); } }
ExpandedMacroBlock extends MacroBlock { @Override public String getContent() { WikiPrinter printer = new DefaultWikiPrinter(); XDOM xdom; if (getChildren().size() == 1 && getChildren().get(0) instanceof XDOM) { xdom = (XDOM) getChildren().get(0); } else { xdom = new XDOM(getChildren()); } getContentRenderer().render(xdom, printer); return printer.toString(); } ExpandedMacroBlock(String id, Map<String, String> parameters, BlockRenderer contentRenderer, boolean inline);  ExpandedMacroBlock(String id, Map<String, String> parameters, BlockRenderer contentRenderer, boolean inline,
        ComponentManager componentManager); }
ExpandedMacroBlock extends MacroBlock { @Override public String getContent() { WikiPrinter printer = new DefaultWikiPrinter(); XDOM xdom; if (getChildren().size() == 1 && getChildren().get(0) instanceof XDOM) { xdom = (XDOM) getChildren().get(0); } else { xdom = new XDOM(getChildren()); } getContentRenderer().render(xdom, printer); return printer.toString(); } ExpandedMacroBlock(String id, Map<String, String> parameters, BlockRenderer contentRenderer, boolean inline);  ExpandedMacroBlock(String id, Map<String, String> parameters, BlockRenderer contentRenderer, boolean inline,
        ComponentManager componentManager); @Override String getContent(); }
ExpandedMacroBlock extends MacroBlock { @Override public String getContent() { WikiPrinter printer = new DefaultWikiPrinter(); XDOM xdom; if (getChildren().size() == 1 && getChildren().get(0) instanceof XDOM) { xdom = (XDOM) getChildren().get(0); } else { xdom = new XDOM(getChildren()); } getContentRenderer().render(xdom, printer); return printer.toString(); } ExpandedMacroBlock(String id, Map<String, String> parameters, BlockRenderer contentRenderer, boolean inline);  ExpandedMacroBlock(String id, Map<String, String> parameters, BlockRenderer contentRenderer, boolean inline,
        ComponentManager componentManager); @Override String getContent();  }