DefaultDocumentEventPersistManager implements DocumentEventPersistManager { @Override public <T> void firePreDocumentEntity(T entity) { entityDocumentPrePersist.fire(EntityDocumentPrePersist.of(entity)); }  @Override void firePreDocument(DocumentEntity entity); @Override void firePostDocument(DocumentEntity entity); @Override void firePreEntity(T entity); @Override void firePostEntity(T entity); @Override void firePreDocumentEntity(T entity); @Override void firePostDocumentEntity(T entity); @Override void firePreQuery(DocumentQuery query); @Override void firePreDeleteQuery(DocumentDeleteQuery query);  }
@Test public void shouldFirePreDocumentEntity() { Jedi jedi = new Jedi(); jedi.name = "Luke"; subject.firePreDocumentEntity(jedi); ArgumentCaptor<EntityDocumentPrePersist> captor = ArgumentCaptor.forClass(EntityDocumentPrePersist.class); verify(entityDocumentPrePersist).fire(captor.capture()); EntityDocumentPrePersist value = captor.getValue(); assertEquals(jedi, value.getValue()); }