@Test void testUpdate1() { App app1 = mock(App.class); App app2 = mock(App.class); Stream<App> apps = Stream.of(app1, app2); appRepositoryDecorator.update(apps); verify(repository).update(app1); verify(repository).update(app2); }
@Override public void update(App app) { App current = findOneById(app.getId()); if (current != null && (current.isActive() != app.isActive())) { if (app.isActive()) { appManagerService.activateApp(app); } else { appManagerService.deactivateApp(app); } } delegate().update(app); }
AppRepositoryDecorator extends AbstractRepositoryDecorator<App> { @Override public void update(App app) { App current = findOneById(app.getId()); if (current != null && (current.isActive() != app.isActive())) { if (app.isActive()) { appManagerService.activateApp(app); } else { appManagerService.deactivateApp(app); } } delegate().update(app); } }
AppRepositoryDecorator extends AbstractRepositoryDecorator<App> { @Override public void update(App app) { App current = findOneById(app.getId()); if (current != null && (current.isActive() != app.isActive())) { if (app.isActive()) { appManagerService.activateApp(app); } else { appManagerService.deactivateApp(app); } } delegate().update(app); } AppRepositoryDecorator(
      Repository<App> delegateRepository, AppManagerService appManagerService); }
AppRepositoryDecorator extends AbstractRepositoryDecorator<App> { @Override public void update(App app) { App current = findOneById(app.getId()); if (current != null && (current.isActive() != app.isActive())) { if (app.isActive()) { appManagerService.activateApp(app); } else { appManagerService.deactivateApp(app); } } delegate().update(app); } 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 update(App app) { App current = findOneById(app.getId()); if (current != null && (current.isActive() != app.isActive())) { if (app.isActive()) { appManagerService.activateApp(app); } else { appManagerService.deactivateApp(app); } } delegate().update(app); } 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);  }