use of org.xwiki.rendering.internal.macro.script.DefaultScriptMacro in project xwiki-platform by xwiki.
the class NestedScriptMacroValidatorTest method configure.
@Before
public void configure() throws Exception {
// Mock macro manager returns a script macro for "script" and null otherwise.
final MacroManager macroManager = getComponentManager().getInstance(MacroManager.class);
final ScriptMacro scriptMacro = new DefaultScriptMacro();
final TestNestedScriptMacroEnabled nestedScriptMacroEnabled = new TestNestedScriptMacroEnabled();
getMockery().checking(new Expectations() {
{
allowing(macroManager).getMacro(with(new MacroId("script")));
will(returnValue(scriptMacro));
allowing(macroManager).getMacro(with(new MacroId("nestedscriptmacroenabled")));
will(returnValue(nestedScriptMacroEnabled));
allowing(macroManager).getMacro(with(any(MacroId.class)));
will(returnValue(null));
}
});
this.validator = getComponentManager().getInstance(EventListener.class, "nestedscriptmacrovalidator");
}
Aggregations