use of org.xwiki.lesscss.internal.LESSContext in project xwiki-platform by xwiki.
the class LESSExportActionListenerTest method onEventWhenHTMLExport.
@Test
public void onEventWhenHTMLExport() throws Exception {
XWikiContext xcontext = mock(XWikiContext.class);
XWikiRequest request = mock(XWikiRequest.class);
when(xcontext.getRequest()).thenReturn(request);
when(request.get("format")).thenReturn("html");
this.mocker.getComponentUnderTest().onEvent(new ActionExecutingEvent("export"), null, xcontext);
// The test is here: we verify that the cache is disabled!
LESSContext lessContext = mocker.getInstance(LESSContext.class);
verify(lessContext).setHtmlExport(true);
}
use of org.xwiki.lesscss.internal.LESSContext 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);
}
Aggregations