@Test void testDeleteAll() { App app1 = mock(App.class); when(app1.getId()).thenReturn("app1"); App app2 = mock(App.class); when(app2.getId()).thenReturn("app2"); Stream<App> apps = Stream.of(app1, app2); when(repository.findAll(new QueryImpl<>())).thenReturn(apps); appRepositoryDecorator.deleteAll(); verify(appManagerService).deleteApp("app1"); verify(repository).deleteById("app1"); verify(appManagerService).deleteApp("app2"); verify(repository).deleteById("app2"); }
@Override public void deleteAll() { findAll(new QueryImpl<>()).forEach(app -> deleteById(app.getId())); }
AppRepositoryDecorator extends AbstractRepositoryDecorator<App> { @Override public void deleteAll() { findAll(new QueryImpl<>()).forEach(app -> deleteById(app.getId())); } }
AppRepositoryDecorator extends AbstractRepositoryDecorator<App> { @Override public void deleteAll() { findAll(new QueryImpl<>()).forEach(app -> deleteById(app.getId())); } AppRepositoryDecorator(
      Repository<App> delegateRepository, AppManagerService appManagerService); }
AppRepositoryDecorator extends AbstractRepositoryDecorator<App> { @Override public void deleteAll() { findAll(new QueryImpl<>()).forEach(app -> deleteById(app.getId())); } AppRepositoryDecorator(
      Repository<App> delegateRepository, AppManagerService appManagerService); @Override void delete(App entity); @Override void deleteById(Object id); @Override void deleteAll(); @Override void update(App app); @Override void update(Stream<App> apps); }
AppRepositoryDecorator extends AbstractRepositoryDecorator<App> { @Override public void deleteAll() { findAll(new QueryImpl<>()).forEach(app -> deleteById(app.getId())); } AppRepositoryDecorator(
      Repository<App> delegateRepository, AppManagerService appManagerService); @Override void delete(App entity); @Override void deleteById(Object id); @Override void deleteAll(); @Override void update(App app); @Override void update(Stream<App> apps);  }