@Test public void testPostUpdate() { context.checking(new Expectations() { { allowing(entity).getId(); will(returnValue(2L)); oneOf(cache).delete(CacheKeys.PERSON_BY_ID + 2L); } }); sut.onPostUpdate(entity); context.assertIsSatisfied(); }
@Override public void onPostUpdate(final Person inUpdatedPerson) { if (log.isInfoEnabled()) { log.info("Person.onPostUpdate - removing person #" + inUpdatedPerson.getId() + " from cache"); } getCache().delete(CacheKeys.PERSON_BY_ID + inUpdatedPerson.getId()); }
PersonEntityCacheUpdater extends CachedDomainMapper implements EntityCacheUpdater<Person> { @Override public void onPostUpdate(final Person inUpdatedPerson) { if (log.isInfoEnabled()) { log.info("Person.onPostUpdate - removing person #" + inUpdatedPerson.getId() + " from cache"); } getCache().delete(CacheKeys.PERSON_BY_ID + inUpdatedPerson.getId()); } }
PersonEntityCacheUpdater extends CachedDomainMapper implements EntityCacheUpdater<Person> { @Override public void onPostUpdate(final Person inUpdatedPerson) { if (log.isInfoEnabled()) { log.info("Person.onPostUpdate - removing person #" + inUpdatedPerson.getId() + " from cache"); } getCache().delete(CacheKeys.PERSON_BY_ID + inUpdatedPerson.getId()); }  }
PersonEntityCacheUpdater extends CachedDomainMapper implements EntityCacheUpdater<Person> { @Override public void onPostUpdate(final Person inUpdatedPerson) { if (log.isInfoEnabled()) { log.info("Person.onPostUpdate - removing person #" + inUpdatedPerson.getId() + " from cache"); } getCache().delete(CacheKeys.PERSON_BY_ID + inUpdatedPerson.getId()); }  @Override void onPostUpdate(final Person inUpdatedPerson); @Override void onPostPersist(final Person inPersistedPerson); }
PersonEntityCacheUpdater extends CachedDomainMapper implements EntityCacheUpdater<Person> { @Override public void onPostUpdate(final Person inUpdatedPerson) { if (log.isInfoEnabled()) { log.info("Person.onPostUpdate - removing person #" + inUpdatedPerson.getId() + " from cache"); } getCache().delete(CacheKeys.PERSON_BY_ID + inUpdatedPerson.getId()); }  @Override void onPostUpdate(final Person inUpdatedPerson); @Override void onPostPersist(final Person inPersistedPerson);  }