use of org.xwiki.bridge.event.ActionExecutingEvent in project xwiki-platform by xwiki.
the class LESSExportActionListenerTest method onEventWhenNonHTMLExport.
@Test
public void onEventWhenNonHTMLExport() throws Exception {
XWikiContext xcontext = mock(XWikiContext.class);
XWikiRequest request = mock(XWikiRequest.class);
when(xcontext.getRequest()).thenReturn(request);
when(request.get("format")).thenReturn("xar");
this.mocker.getComponentUnderTest().onEvent(new ActionExecutingEvent("export"), null, xcontext);
// The test is here: we verify that the we do not disable the LESS cache (since the export is not an HTML
// export). Actually that the context object was not called at all...
LESSContext lessContext = mocker.getInstance(LESSContext.class);
verifyZeroInteractions(lessContext);
}
use of org.xwiki.bridge.event.ActionExecutingEvent in project xwiki-platform by xwiki.
the class LESSExportActionListenerTest method getEvents.
@Test
public void getEvents() throws Exception {
assertEquals(1, this.mocker.getComponentUnderTest().getEvents().size());
assertEquals(new ActionExecutingEvent("export"), this.mocker.getComponentUnderTest().getEvents().get(0));
}
Aggregations