@Test void testDeleteByIdValid() { Package package_ = mock(Package.class); Object id = mock(Object.class); when(delegateRepository.findOneById(id)).thenReturn(package_); packageRepositoryValidationDecorator.deleteById(id); verify(packageValidator).validate(package_, ValidationMode.DELETE); verify(delegateRepository).deleteById(id); }
@Override public void deleteById(Object id) { Package aPackage = findOneById(id); if (aPackage == null) { throw new UnknownEntityException(getEntityType(), id); } packageValidator.validate(aPackage, ValidationMode.DELETE); super.deleteById(id); }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteById(Object id) { Package aPackage = findOneById(id); if (aPackage == null) { throw new UnknownEntityException(getEntityType(), id); } packageValidator.validate(aPackage, ValidationMode.DELETE); super.deleteById(id); } }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteById(Object id) { Package aPackage = findOneById(id); if (aPackage == null) { throw new UnknownEntityException(getEntityType(), id); } packageValidator.validate(aPackage, ValidationMode.DELETE); super.deleteById(id); } PackageRepositoryValidationDecorator(
      Repository<Package> delegateRepository, PackageValidator packageValidator); }
PackageRepositoryValidationDecorator extends AbstractRepositoryDecorator<Package> { @Override public void deleteById(Object id) { Package aPackage = findOneById(id); if (aPackage == null) { throw new UnknownEntityException(getEntityType(), id); } packageValidator.validate(aPackage, ValidationMode.DELETE); super.deleteById(id); } 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 deleteById(Object id) { Package aPackage = findOneById(id); if (aPackage == null) { throw new UnknownEntityException(getEntityType(), id); } packageValidator.validate(aPackage, ValidationMode.DELETE); super.deleteById(id); } 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);  }