@Test public void testExecute() { final Long personId = 3882L; final Cache cache = context.mock(Cache.class); RemoveCachedPersonModelViewCacheMapper sut = new RemoveCachedPersonModelViewCacheMapper(); sut.setCache(cache); context.checking(new Expectations() { { oneOf(cache).delete(CacheKeys.PERSON_BY_ID + personId); } }); sut.execute(personId); }
@Override public Boolean execute(final Long inPersonId) { String cacheKey = CacheKeys.PERSON_BY_ID + inPersonId; log.info("Removing person #" + inPersonId + " from cache by deleting cache key " + cacheKey); getCache().delete(cacheKey); return true; }
RemoveCachedPersonModelViewCacheMapper extends CachedDomainMapper implements DomainMapper<Long, Boolean> { @Override public Boolean execute(final Long inPersonId) { String cacheKey = CacheKeys.PERSON_BY_ID + inPersonId; log.info("Removing person #" + inPersonId + " from cache by deleting cache key " + cacheKey); getCache().delete(cacheKey); return true; } }
RemoveCachedPersonModelViewCacheMapper extends CachedDomainMapper implements DomainMapper<Long, Boolean> { @Override public Boolean execute(final Long inPersonId) { String cacheKey = CacheKeys.PERSON_BY_ID + inPersonId; log.info("Removing person #" + inPersonId + " from cache by deleting cache key " + cacheKey); getCache().delete(cacheKey); return true; }  }
RemoveCachedPersonModelViewCacheMapper extends CachedDomainMapper implements DomainMapper<Long, Boolean> { @Override public Boolean execute(final Long inPersonId) { String cacheKey = CacheKeys.PERSON_BY_ID + inPersonId; log.info("Removing person #" + inPersonId + " from cache by deleting cache key " + cacheKey); getCache().delete(cacheKey); return true; }  @Override Boolean execute(final Long inPersonId); }
RemoveCachedPersonModelViewCacheMapper extends CachedDomainMapper implements DomainMapper<Long, Boolean> { @Override public Boolean execute(final Long inPersonId) { String cacheKey = CacheKeys.PERSON_BY_ID + inPersonId; log.info("Removing person #" + inPersonId + " from cache by deleting cache key " + cacheKey); getCache().delete(cacheKey); return true; }  @Override Boolean execute(final Long inPersonId);  }