### Question:
RenderingScriptService implements ScriptService { public XDOM parse(String text, String syntaxId) { XDOM result; try { Parser parser = this.componentManagerProvider.get().getInstance(Parser.class, syntaxId); result = parser.parse(new StringReader(text)); } catch (Exception e) { result = null; } return result; }  List<Syntax> getAvailableParserSyntaxes(); List<Syntax> getAvailableRendererSyntaxes(); List<String> getDefaultTransformationNames(); XDOM parse(String text, String syntaxId); String render(Block block, String outputSyntaxId); Syntax resolveSyntax(String syntaxId); String escape(String content, Syntax syntax); List<Syntax> getConfiguredSyntaxes(); List<Syntax> getDisabledSyntaxes(); List<MacroDescriptor> getMacroDescriptors(Syntax syntax); MacroId resolveMacroId(String macroIdAsString); MacroDescriptor getMacroDescriptor(MacroId macroId);  }### Answer:
@Test public void parseAndRenderWhenErrorInParse() throws Exception { Parser parser = this.mocker.registerMockComponent(Parser.class, "plain/1.0"); when(parser.parse(new StringReader("some [[TODO]] stuff"))).thenThrow(new ParseException(("error"))); Assert.assertNull(this.mocker.getComponentUnderTest().parse("some [[TODO]] stuff", "plain/1.0")); }