@Test void onEvent() { DocumentReference documentReference = new DocumentReference("xwiki", "XWiki", "Doc"); DocumentReference authorReference = new DocumentReference("xwiki", "XWiki", "Author"); DocumentUpdatedEvent event = new DocumentUpdatedEvent(documentReference); when(this.document.getDocumentReference()).thenReturn(documentReference); when(this.document.getAuthorReference()).thenReturn(authorReference); when(this.document.getVersion()).thenReturn("2.1"); this.listener.onEvent(event, this.document, null); assertEquals(1, this.logCapture.size()); assertEquals(Level.DEBUG, this.logCapture.getLogEvent(0).getLevel()); assertEquals( "Event [org.xwiki.bridge.event.DocumentUpdatedEvent] received from [document] with data [null].", this.logCapture.getMessage(0)); verify(this.executor).execute(documentReference, authorReference, "2.1"); }
@Override public void onEvent(Event event, Object source, Object data) { if (!(event instanceof DocumentUpdatedEvent) || this.remoteObservationManagerContext.isRemoteState()) { return; } this.logger.debug("Event [{}] received from [{}] with data [{}].", DocumentUpdatedEvent.class.getName(), source, data); XWikiDocument doc = (XWikiDocument) source; this.executor.execute(doc.getDocumentReference(), doc.getAuthorReference(), doc.getVersion()); }
MentionsUpdatedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (!(event instanceof DocumentUpdatedEvent) || this.remoteObservationManagerContext.isRemoteState()) { return; } this.logger.debug("Event [{}] received from [{}] with data [{}].", DocumentUpdatedEvent.class.getName(), source, data); XWikiDocument doc = (XWikiDocument) source; this.executor.execute(doc.getDocumentReference(), doc.getAuthorReference(), doc.getVersion()); } }
MentionsUpdatedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (!(event instanceof DocumentUpdatedEvent) || this.remoteObservationManagerContext.isRemoteState()) { return; } this.logger.debug("Event [{}] received from [{}] with data [{}].", DocumentUpdatedEvent.class.getName(), source, data); XWikiDocument doc = (XWikiDocument) source; this.executor.execute(doc.getDocumentReference(), doc.getAuthorReference(), doc.getVersion()); } MentionsUpdatedEventListener(); }
MentionsUpdatedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (!(event instanceof DocumentUpdatedEvent) || this.remoteObservationManagerContext.isRemoteState()) { return; } this.logger.debug("Event [{}] received from [{}] with data [{}].", DocumentUpdatedEvent.class.getName(), source, data); XWikiDocument doc = (XWikiDocument) source; this.executor.execute(doc.getDocumentReference(), doc.getAuthorReference(), doc.getVersion()); } MentionsUpdatedEventListener(); @Override void onEvent(Event event, Object source, Object data); }
MentionsUpdatedEventListener extends AbstractEventListener { @Override public void onEvent(Event event, Object source, Object data) { if (!(event instanceof DocumentUpdatedEvent) || this.remoteObservationManagerContext.isRemoteState()) { return; } this.logger.debug("Event [{}] received from [{}] with data [{}].", DocumentUpdatedEvent.class.getName(), source, data); XWikiDocument doc = (XWikiDocument) source; this.executor.execute(doc.getDocumentReference(), doc.getAuthorReference(), doc.getVersion()); } MentionsUpdatedEventListener(); @Override void onEvent(Event event, Object source, Object data);  }