@SuppressWarnings("ResultOfMethodCallIgnored") @Test void testUpdateStreamInvalid() { Package package_ = mock(Package.class); doThrow(mock(MolgenisValidationException.class)) .when(packageValidator) .validate(package_, ValidationMode.UPDATE); packageRepositoryValidationDecorator.update(Stream.of(package_)); @SuppressWarnings("unchecked") ArgumentCaptor<Stream<Package>> packageCaptor = ArgumentCaptor.forClass(Stream.class); verify(delegateRepository).update(packageCaptor.capture()); assertThrows(MolgenisValidationException.class, () -> packageCaptor.getValue().count()); }
@Override public void update(Package aPackage) { packageValidator.validate(aPackage, ValidationMode.UPDATE); delegate().update(aPackage); }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void update(Package aPackage) { packageValidator.validate(aPackage, ValidationMode.UPDATE); delegate().update(aPackage); } }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void update(Package aPackage) { packageValidator.validate(aPackage, ValidationMode.UPDATE); delegate().update(aPackage); } PackageRepositoryValidationDecorator(
      Repository<Package> delegateRepository, PackageValidator packageValidator); }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void update(Package aPackage) { packageValidator.validate(aPackage, ValidationMode.UPDATE); delegate().update(aPackage); } 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 update(Package aPackage) { packageValidator.validate(aPackage, ValidationMode.UPDATE); delegate().update(aPackage); } 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);  }