@Test void testDeleteAll() { EntityType entityType = mock(EntityType.class); when(delegateRepository.getEntityType()).thenReturn(entityType); l1CacheRepositoryDecorator.deleteAll(); verify(l1CacheJanitor).cleanCacheBeforeDeleteAll(entityType); verify(l1Cache).evictAll(entityType); verify(delegateRepository).deleteAll(); verifyNoMoreInteractions(l1CacheJanitor, l1Cache, delegateRepository); }
@Override public void deleteAll(Stream<Object> ids) { if (useCache()) { EntityType entityType = getEntityType(); ids = l1CacheJanitor .cleanCacheBeforeDeleteById(entityType, ids) .filter(id -> this.delCache(entityType, id)); } delegate().deleteAll(ids); }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { if (useCache()) { EntityType entityType = getEntityType(); ids = l1CacheJanitor .cleanCacheBeforeDeleteById(entityType, ids) .filter(id -> this.delCache(entityType, id)); } delegate().deleteAll(ids); } }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { if (useCache()) { EntityType entityType = getEntityType(); ids = l1CacheJanitor .cleanCacheBeforeDeleteById(entityType, ids) .filter(id -> this.delCache(entityType, id)); } delegate().deleteAll(ids); } L1CacheRepositoryDecorator(
      Repository<Entity> delegateRepository, L1Cache l1Cache, L1CacheJanitor l1CacheJanitor); }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { if (useCache()) { EntityType entityType = getEntityType(); ids = l1CacheJanitor .cleanCacheBeforeDeleteById(entityType, ids) .filter(id -> this.delCache(entityType, id)); } delegate().deleteAll(ids); } L1CacheRepositoryDecorator(
      Repository<Entity> delegateRepository, L1Cache l1Cache, L1CacheJanitor l1CacheJanitor); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll(); }
L1CacheRepositoryDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void deleteAll(Stream<Object> ids) { if (useCache()) { EntityType entityType = getEntityType(); ids = l1CacheJanitor .cleanCacheBeforeDeleteById(entityType, ids) .filter(id -> this.delCache(entityType, id)); } delegate().deleteAll(ids); } L1CacheRepositoryDecorator(
      Repository<Entity> delegateRepository, L1Cache l1Cache, L1CacheJanitor l1CacheJanitor); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override Entity findOneById(Object id); @Override Entity findOneById(Object id, Fetch fetch); @Override Stream<Entity> findAll(Stream<Object> ids); @Override Stream<Entity> findAll(Stream<Object> ids, Fetch fetch); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void delete(Entity entity); @Override void delete(Stream<Entity> entities); @Override void deleteById(Object id); @Override void deleteAll(Stream<Object> ids); @Override void deleteAll();  }