use of org.xwiki.lesscss.internal.skin.DocumentSkinReference in project xwiki-platform by xwiki.
the class SkinListenerTest method onEventWhenSkinIsChanged.
@Test
public void onEventWhenSkinIsChanged() throws Exception {
// Mocks
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<>();
BaseObject object = mock(BaseObject.class);
objects.add(object);
when(doc.getXObjects(classReference)).thenReturn(objects);
DocumentReference documentReference = new DocumentReference("wiki", "space", "page");
when(doc.getDocumentReference()).thenReturn(documentReference);
DocumentSkinReference skinReference = new DocumentSkinReference(documentReference, null);
when(skinReferenceFactory.createReference(documentReference)).thenReturn(skinReference);
// Test
mocker.getComponentUnderTest().onEvent(event, doc, data);
// Verify
verify(lessResourcesCache).clearFromSkin(skinReference);
verify(colorThemeCache).clearFromSkin(skinReference);
}
Aggregations