@Test void deleteById() { Package groupPackage = mockGroupPackage("test"); when(delegateRepository.findOneById("test")).thenReturn(groupPackage); groupPackageRepositoryDecorator.deleteById("test"); assertAll( () -> verify(groupPackageService).deleteGroup(groupPackage), () -> verify(delegateRepository).findOneById("test"), () -> verify(delegateRepository).delete(groupPackage)); }
@Override public void deleteById(Object id) { Package aPackage = getPackage(id); if (isGroupPackage(aPackage)) { groupPackageService.deleteGroup(aPackage); } super.delete(aPackage); }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteById(Object id) { Package aPackage = getPackage(id); if (isGroupPackage(aPackage)) { groupPackageService.deleteGroup(aPackage); } super.delete(aPackage); } }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteById(Object id) { Package aPackage = getPackage(id); if (isGroupPackage(aPackage)) { groupPackageService.deleteGroup(aPackage); } super.delete(aPackage); } GroupPackageRepositoryDecorator(
      Repository<Package> delegateRepository, GroupPackageService groupPackageService); }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteById(Object id) { Package aPackage = getPackage(id); if (isGroupPackage(aPackage)) { groupPackageService.deleteGroup(aPackage); } super.delete(aPackage); } GroupPackageRepositoryDecorator(
      Repository<Package> delegateRepository, GroupPackageService groupPackageService); @Override void add(Package aPackage); @Override Integer add(Stream<Package> packageStream); @Override void update(Package aPackage); @Override void update(Stream<Package> packageStream); @Override void delete(Package aPackage); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Package> packages); @Override void deleteAll(Stream<Object> ids); }
GroupPackageRepositoryDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteById(Object id) { Package aPackage = getPackage(id); if (isGroupPackage(aPackage)) { groupPackageService.deleteGroup(aPackage); } super.delete(aPackage); } GroupPackageRepositoryDecorator(
      Repository<Package> delegateRepository, GroupPackageService groupPackageService); @Override void add(Package aPackage); @Override Integer add(Stream<Package> packageStream); @Override void update(Package aPackage); @Override void update(Stream<Package> packageStream); @Override void delete(Package aPackage); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Package> packages); @Override void deleteAll(Stream<Object> ids);  }