@Test void testValidateEntityNotReferencedValidationException() { Attribute attribute = createMockAttribute(AttributeType.XREF, "id"); initializeDataServiceMock(Stream.of(attribute)); Entity entity = createMockEntity("id"); Exception exception = assertThrows( MolgenisValidationException.class, () -> defaultValueReferenceValidator.validateEntityNotReferenced(entity)); assertThat(exception.getMessage()) .containsPattern( "'My Entity Type' with id 'id' is referenced as default value by attribute\\(s\\): 'myAttribute'"); }
@Override public void validateEntityNotReferenced(Entity entity) { validateEntityNotReferencedById(entity.getIdValue(), entity.getEntityType()); }
DefaultValueReferenceValidatorImpl implements DefaultValueReferenceValidator { @Override public void validateEntityNotReferenced(Entity entity) { validateEntityNotReferencedById(entity.getIdValue(), entity.getEntityType()); } }
DefaultValueReferenceValidatorImpl implements DefaultValueReferenceValidator { @Override public void validateEntityNotReferenced(Entity entity) { validateEntityNotReferencedById(entity.getIdValue(), entity.getEntityType()); } DefaultValueReferenceValidatorImpl(DataService dataService); }
DefaultValueReferenceValidatorImpl implements DefaultValueReferenceValidator { @Override public void validateEntityNotReferenced(Entity entity) { validateEntityNotReferencedById(entity.getIdValue(), entity.getEntityType()); } DefaultValueReferenceValidatorImpl(DataService dataService); @Override void validateEntityNotReferenced(Entity entity); @Override Stream<Entity> validateEntitiesNotReferenced(
      Stream<Entity> entityStream, EntityType entityType); @Override void validateEntityNotReferencedById(Object entityId, EntityType entityType); @Override Stream<Object> validateEntitiesNotReferencedById(
      Stream<Object> entityIdStream, EntityType entityType); @Override void validateEntityTypeNotReferenced(EntityType entityType); }
DefaultValueReferenceValidatorImpl implements DefaultValueReferenceValidator { @Override public void validateEntityNotReferenced(Entity entity) { validateEntityNotReferencedById(entity.getIdValue(), entity.getEntityType()); } DefaultValueReferenceValidatorImpl(DataService dataService); @Override void validateEntityNotReferenced(Entity entity); @Override Stream<Entity> validateEntitiesNotReferenced(
      Stream<Entity> entityStream, EntityType entityType); @Override void validateEntityNotReferencedById(Object entityId, EntityType entityType); @Override Stream<Object> validateEntitiesNotReferencedById(
      Stream<Object> entityIdStream, EntityType entityType); @Override void validateEntityTypeNotReferenced(EntityType entityType);  }