@Test public void onEventWhenNoObject() throws Exception { Event event = mock(Event.class); XWikiDocument doc = mock(XWikiDocument.class); Object data = new Object(); EntityReference classReference = new LocalDocumentReference("XWiki", "XWikiSkins"); List<BaseObject> objects = new ArrayList<>(); when(doc.getXObjects(classReference)).thenReturn(objects); mocker.getComponentUnderTest().onEvent(event, doc, data); verifyZeroInteractions(lessResourcesCache); verifyZeroInteractions(colorThemeCache); }
@Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; List<BaseObject> skinObjects = document.getXObjects(SKIN_CLASS); if (skinObjects != null && !skinObjects.isEmpty()) { clearCacheFromSkin(document); return; } }
SkinListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; List<BaseObject> skinObjects = document.getXObjects(SKIN_CLASS); if (skinObjects != null && !skinObjects.isEmpty()) { clearCacheFromSkin(document); return; } } }
SkinListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; List<BaseObject> skinObjects = document.getXObjects(SKIN_CLASS); if (skinObjects != null && !skinObjects.isEmpty()) { clearCacheFromSkin(document); return; } }  }
SkinListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; List<BaseObject> skinObjects = document.getXObjects(SKIN_CLASS); if (skinObjects != null && !skinObjects.isEmpty()) { clearCacheFromSkin(document); return; } }  @Override String getName(); @Override List<Event> getEvents(); @Override void onEvent(Event event, Object source, Object data); }
SkinListener implements EventListener { @Override public void onEvent(Event event, Object source, Object data) { XWikiDocument document = (XWikiDocument) source; List<BaseObject> skinObjects = document.getXObjects(SKIN_CLASS); if (skinObjects != null && !skinObjects.isEmpty()) { clearCacheFromSkin(document); return; } }  @Override String getName(); @Override List<Event> getEvents(); @Override void onEvent(Event event, Object source, Object data);  }