@Test public void resolveMacroIdInvalid() throws Exception { MacroIdFactory macroIdFactory = this.mocker.registerMockComponent(MacroIdFactory.class); when(macroIdFactory.createMacroId("foo")).thenThrow(new ParseException("Invalid macro id")); assertNull(this.mocker.getComponentUnderTest().resolveMacroId("foo")); }
public MacroId resolveMacroId(String macroIdAsString) { try { return this.macroIdFactory.createMacroId(macroIdAsString); } catch (ParseException e) { this.logger.warn("Failed to resolve macro id [{}]. Root cause is: [{}]", macroIdAsString, ExceptionUtils.getRootCauseMessage(e)); return null; } }
RenderingScriptService implements ScriptService { public MacroId resolveMacroId(String macroIdAsString) { try { return this.macroIdFactory.createMacroId(macroIdAsString); } catch (ParseException e) { this.logger.warn("Failed to resolve macro id [{}]. Root cause is: [{}]", macroIdAsString, ExceptionUtils.getRootCauseMessage(e)); return null; } } }
RenderingScriptService implements ScriptService { public MacroId resolveMacroId(String macroIdAsString) { try { return this.macroIdFactory.createMacroId(macroIdAsString); } catch (ParseException e) { this.logger.warn("Failed to resolve macro id [{}]. Root cause is: [{}]", macroIdAsString, ExceptionUtils.getRootCauseMessage(e)); return null; } }  }
RenderingScriptService implements ScriptService { public MacroId resolveMacroId(String macroIdAsString) { try { return this.macroIdFactory.createMacroId(macroIdAsString); } catch (ParseException e) { this.logger.warn("Failed to resolve macro id [{}]. Root cause is: [{}]", macroIdAsString, ExceptionUtils.getRootCauseMessage(e)); return null; } }  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); }
RenderingScriptService implements ScriptService { public MacroId resolveMacroId(String macroIdAsString) { try { return this.macroIdFactory.createMacroId(macroIdAsString); } catch (ParseException e) { this.logger.warn("Failed to resolve macro id [{}]. Root cause is: [{}]", macroIdAsString, ExceptionUtils.getRootCauseMessage(e)); return null; } }  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);  }