@Test void testDelete() { Entity entity = mock(Entity.class); repositoryValidationDecorator.delete(entity); verify(delegateRepository).delete(entity); verify(defaultValueReferenceValidator).validateEntityNotReferenced(entity); }
@Override public void delete(Entity entity) { defaultValueReferenceValidator.validateEntityNotReferenced(entity); delegate().delete(entity); }
RepositoryValidationDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void delete(Entity entity) { defaultValueReferenceValidator.validateEntityNotReferenced(entity); delegate().delete(entity); } }
RepositoryValidationDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void delete(Entity entity) { defaultValueReferenceValidator.validateEntityNotReferenced(entity); delegate().delete(entity); } RepositoryValidationDecorator(
      DataService dataService,
      Repository<Entity> delegateRepository,
      EntityAttributesValidator entityAttributesValidator,
      DefaultValueReferenceValidator defaultValueReferenceValidator); }
RepositoryValidationDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void delete(Entity entity) { defaultValueReferenceValidator.validateEntityNotReferenced(entity); delegate().delete(entity); } RepositoryValidationDecorator(
      DataService dataService,
      Repository<Entity> delegateRepository,
      EntityAttributesValidator entityAttributesValidator,
      DefaultValueReferenceValidator defaultValueReferenceValidator); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override void delete(Entity entity); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Entity> entities); @Override void deleteAll(Stream<Object> ids); }
RepositoryValidationDecorator extends AbstractRepositoryDecorator<Entity> { @Override public void delete(Entity entity) { defaultValueReferenceValidator.validateEntityNotReferenced(entity); delegate().delete(entity); } RepositoryValidationDecorator(
      DataService dataService,
      Repository<Entity> delegateRepository,
      EntityAttributesValidator entityAttributesValidator,
      DefaultValueReferenceValidator defaultValueReferenceValidator); @Override void update(Entity entity); @Override void update(Stream<Entity> entities); @Override void add(Entity entity); @Override Integer add(Stream<Entity> entities); @Override void delete(Entity entity); @Override void deleteById(Object id); @Override void deleteAll(); @Override void delete(Stream<Entity> entities); @Override void deleteAll(Stream<Object> ids);  }