DefaultDocumentEventPersistManager implements DocumentEventPersistManager { @Override public void firePreQuery(DocumentQuery query) { documentQueryExecute.fire(DocumentQueryExecute.of(query)); }  @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 shouldFirePreQuery() { DocumentQuery query = select().from("collection").build(); subject.firePreQuery(query); ArgumentCaptor<DocumentQueryExecute> captor = ArgumentCaptor.forClass(DocumentQueryExecute.class); verify(documentQueryExecute).fire(captor.capture()); assertEquals(query, captor.getValue().getQuery()); }