@Test void execute() throws InterruptedException { DocumentReference documentReference = new DocumentReference("xwiki", "XWiki", "Doc"); DocumentReference authorReference = new DocumentReference("xwiki", "XWiki", "Author"); when(this.serializer.serialize(documentReference)).thenReturn("xwiki:XWiki.Doc"); when(this.serializer.serialize(authorReference)).thenReturn("xwiki:XWiki.Author"); this.executor.execute(documentReference, authorReference, "1.0"); verify(this.blockingQueue) .put(new MentionsData() .setWikiId("xwiki") .setAuthorReference("xwiki:XWiki.Author") .setDocumentReference("xwiki:XWiki.Doc") .setVersion("1.0")); }
@Override public void execute(DocumentReference documentReference, DocumentReference authorReference, String version) { MentionsData mentionsData = new MentionsData() .setDocumentReference(this.serializer.serialize(documentReference)); if (authorReference != null) { mentionsData = mentionsData .setAuthorReference(this.serializer.serialize(authorReference)); } MentionsData data = mentionsData .setVersion(version) .setWikiId(documentReference.getWikiReference().getName()); try { this.queue.put(data); } catch (InterruptedException e) { this.logger .warn("Error while adding the task [{}] to the mentions analysis queue. Cause [{}]", data, getRootCauseMessage(e)); } }
DefaultMentionsEventExecutor implements MentionsEventExecutor, Initializable, Disposable { @Override public void execute(DocumentReference documentReference, DocumentReference authorReference, String version) { MentionsData mentionsData = new MentionsData() .setDocumentReference(this.serializer.serialize(documentReference)); if (authorReference != null) { mentionsData = mentionsData .setAuthorReference(this.serializer.serialize(authorReference)); } MentionsData data = mentionsData .setVersion(version) .setWikiId(documentReference.getWikiReference().getName()); try { this.queue.put(data); } catch (InterruptedException e) { this.logger .warn("Error while adding the task [{}] to the mentions analysis queue. Cause [{}]", data, getRootCauseMessage(e)); } } }
DefaultMentionsEventExecutor implements MentionsEventExecutor, Initializable, Disposable { @Override public void execute(DocumentReference documentReference, DocumentReference authorReference, String version) { MentionsData mentionsData = new MentionsData() .setDocumentReference(this.serializer.serialize(documentReference)); if (authorReference != null) { mentionsData = mentionsData .setAuthorReference(this.serializer.serialize(authorReference)); } MentionsData data = mentionsData .setVersion(version) .setWikiId(documentReference.getWikiReference().getName()); try { this.queue.put(data); } catch (InterruptedException e) { this.logger .warn("Error while adding the task [{}] to the mentions analysis queue. Cause [{}]", data, getRootCauseMessage(e)); } }  }
DefaultMentionsEventExecutor implements MentionsEventExecutor, Initializable, Disposable { @Override public void execute(DocumentReference documentReference, DocumentReference authorReference, String version) { MentionsData mentionsData = new MentionsData() .setDocumentReference(this.serializer.serialize(documentReference)); if (authorReference != null) { mentionsData = mentionsData .setAuthorReference(this.serializer.serialize(authorReference)); } MentionsData data = mentionsData .setVersion(version) .setWikiId(documentReference.getWikiReference().getName()); try { this.queue.put(data); } catch (InterruptedException e) { this.logger .warn("Error while adding the task [{}] to the mentions analysis queue. Cause [{}]", data, getRootCauseMessage(e)); } }  @Override void initialize(); @Override void startThreads(); @Override void dispose(); @Override void execute(DocumentReference documentReference, DocumentReference authorReference, String version); @Override long getQueueSize(); List<MentionsConsumer> getConsumers(); }
DefaultMentionsEventExecutor implements MentionsEventExecutor, Initializable, Disposable { @Override public void execute(DocumentReference documentReference, DocumentReference authorReference, String version) { MentionsData mentionsData = new MentionsData() .setDocumentReference(this.serializer.serialize(documentReference)); if (authorReference != null) { mentionsData = mentionsData .setAuthorReference(this.serializer.serialize(authorReference)); } MentionsData data = mentionsData .setVersion(version) .setWikiId(documentReference.getWikiReference().getName()); try { this.queue.put(data); } catch (InterruptedException e) { this.logger .warn("Error while adding the task [{}] to the mentions analysis queue. Cause [{}]", data, getRootCauseMessage(e)); } }  @Override void initialize(); @Override void startThreads(); @Override void dispose(); @Override void execute(DocumentReference documentReference, DocumentReference authorReference, String version); @Override long getQueueSize(); List<MentionsConsumer> getConsumers();  }