DefaultKeyValueEventPersistManager implements KeyValueEventPersistManager { @Override public <T> void firePreEntity(T entity) { entityPrePersistEvent.fire(EntityPrePersist.of(entity)); }  @Override void firePreKeyValue(KeyValueEntity<?> entity); @Override void firePostKeyValue(KeyValueEntity<?> entity); @Override void firePreEntity(T entity); @Override void firePostEntity(T entity); @Override void firePreKeyValueEntity(T entity); @Override void firePostKeyValueEntity(T entity);  }
@Test public void shouldFirePreEntity() { Actor actor = new Actor(); actor.name = "Luke"; subject.firePreEntity(actor); ArgumentCaptor<EntityPrePersist> captor = ArgumentCaptor.forClass(EntityPrePersist.class); verify(entityPrePersistEvent).fire(captor.capture()); EntityPrePersist value = captor.getValue(); assertEquals(actor, value.getValue()); }