### Question:
RenderingScriptService implements ScriptService { public List<MacroDescriptor> getMacroDescriptors(Syntax syntax) throws MacroLookupException { List<MacroDescriptor> macroDescriptors = new ArrayList<>(); for (MacroId id : this.macroManager.getMacroIds(syntax)) { macroDescriptors.add(this.macroManager.getMacro(id).getDescriptor()); } return macroDescriptors; }  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 getMacroDescriptors() throws Exception { MacroManager macroManager = this.mocker.registerMockComponent(MacroManager.class); MacroId macroId = new MacroId("macroid"); when(macroManager.getMacroIds(Syntax.XWIKI_2_1)).thenReturn(Collections.singleton(macroId)); Macro macro = mock(Macro.class); when(macroManager.getMacro(macroId)).thenReturn(macro); MacroDescriptor descriptor = mock(MacroDescriptor.class); when(macro.getDescriptor()).thenReturn(descriptor); List<MacroDescriptor> descriptors = this.mocker.getComponentUnderTest().getMacroDescriptors(Syntax.XWIKI_2_1); assertEquals(1, descriptors.size()); assertSame(descriptor, descriptors.get(0)); }