@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); LESSContext lessContext = mocker.getInstance(LESSContext.class); verify(lessContext).setHtmlExport(true); }
@Override public void onEvent(Event event, Object source, Object data) { XWikiContext xcontext = (XWikiContext) data; XWikiRequest request = xcontext.getRequest(); String format = request.get("format"); if ("html".equals(format)) { lessContext.setHtmlExport(true); } }
LESSExportActionListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiContext xcontext = (XWikiContext) data; XWikiRequest request = xcontext.getRequest(); String format = request.get("format"); if ("html".equals(format)) { lessContext.setHtmlExport(true); } } }
LESSExportActionListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiContext xcontext = (XWikiContext) data; XWikiRequest request = xcontext.getRequest(); String format = request.get("format"); if ("html".equals(format)) { lessContext.setHtmlExport(true); } }  }
LESSExportActionListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiContext xcontext = (XWikiContext) data; XWikiRequest request = xcontext.getRequest(); String format = request.get("format"); if ("html".equals(format)) { lessContext.setHtmlExport(true); } }  @Override String getName(); @Override List<Event> getEvents(); @Override void onEvent(Event event, Object source, Object data); }
LESSExportActionListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiContext xcontext = (XWikiContext) data; XWikiRequest request = xcontext.getRequest(); String format = request.get("format"); if ("html".equals(format)) { lessContext.setHtmlExport(true); } }  @Override String getName(); @Override List<Event> getEvents(); @Override void onEvent(Event event, Object source, Object data);  }