### Question:
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();  }### Answer:
@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")); }
@Test void executeInterruptedException() throws InterruptedException { DocumentReference documentReference = new DocumentReference("xwiki", "XWiki", "Doc"); DocumentReference authorReference = new DocumentReference("xwiki", "XWiki", "Author"); MentionsData data = new MentionsData() .setDocumentReference("xwiki:XWiki.Doc") .setAuthorReference("xwiki:XWiki.Author") .setVersion("1.0") .setWikiId("xwiki"); when(this.serializer.serialize(documentReference)).thenReturn("xwiki:XWiki.Doc"); when(this.serializer.serialize(authorReference)).thenReturn("xwiki:XWiki.Author"); doThrow(new InterruptedException()).when(this.blockingQueue).put(data); this.executor.execute(documentReference, authorReference, "1.0"); assertEquals(1, this.logCapture.size()); assertEquals(WARN, this.logCapture.getLogEvent(0).getLevel()); assertEquals( "Error while adding the task [documentReference = [xwiki:XWiki.Doc], version = [1.0], " + "authorReference = [xwiki:XWiki.Author], wikiId = [xwiki]] " + "to the mentions analysis queue. Cause [InterruptedException: ]", this.logCapture.getMessage(0)); }