@Test void testDeleteAllInvalid() { Package package_ = mock(Package.class); when(delegateRepository.iterator()).thenReturn(singletonList(package_).iterator()); doThrow(mock(MolgenisValidationException.class)) .when(packageValidator) .validate(package_, ValidationMode.DELETE); assertThrows( MolgenisValidationException.class, () -> packageRepositoryValidationDecorator.deleteAll()); }
@Override public void deleteAll() { iterator() .forEachRemaining(aPackage -> packageValidator.validate(aPackage, ValidationMode.DELETE)); super.deleteAll(); }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteAll() { iterator() .forEachRemaining(aPackage -> packageValidator.validate(aPackage, ValidationMode.DELETE)); super.deleteAll(); } }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteAll() { iterator() .forEachRemaining(aPackage -> packageValidator.validate(aPackage, ValidationMode.DELETE)); super.deleteAll(); } PackageRepositoryValidationDecorator(
      Repository<Package> delegateRepository, PackageValidator packageValidator); }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteAll() { iterator() .forEachRemaining(aPackage -> packageValidator.validate(aPackage, ValidationMode.DELETE)); super.deleteAll(); } PackageRepositoryValidationDecorator(
      Repository<Package> delegateRepository, PackageValidator packageValidator); @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 delete(Stream<Package> packageStream); @Override void deleteById(Object id); @Override void deleteAll(); @Override void deleteAll(Stream<Object> ids); }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteAll() { iterator() .forEachRemaining(aPackage -> packageValidator.validate(aPackage, ValidationMode.DELETE)); super.deleteAll(); } PackageRepositoryValidationDecorator(
      Repository<Package> delegateRepository, PackageValidator packageValidator); @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 delete(Stream<Package> packageStream); @Override void deleteById(Object id); @Override void deleteAll(); @Override void deleteAll(Stream<Object> ids);  }