@Test void testValidateEntityNotReferencedByIdValidationException() { Attribute attribute = createMockAttribute(AttributeType.XREF, "id"); initializeDataServiceMock(Stream.of(attribute)); Exception exception = assertThrows( MolgenisValidationException.class, () -> defaultValueReferenceValidator.validateEntityNotReferencedById("id", entityType)); assertThat(exception.getMessage()) .containsPattern( "'My Entity Type' with id 'id' is referenced as default value by attribute\\(s\\): 'myAttribute'"); }
@Override public void validateEntityNotReferencedById(Object entityId, EntityType entityType) { validateEntityNotReferenced(entityId, entityType, getDefaultValueMap(entityType)); }
DefaultValueReferenceValidatorImpl implements DefaultValueReferenceValidator { @Override public void validateEntityNotReferencedById(Object entityId, EntityType entityType) { validateEntityNotReferenced(entityId, entityType, getDefaultValueMap(entityType)); } }
DefaultValueReferenceValidatorImpl implements DefaultValueReferenceValidator { @Override public void validateEntityNotReferencedById(Object entityId, EntityType entityType) { validateEntityNotReferenced(entityId, entityType, getDefaultValueMap(entityType)); } DefaultValueReferenceValidatorImpl(DataService dataService); }
DefaultValueReferenceValidatorImpl implements DefaultValueReferenceValidator { @Override public void validateEntityNotReferencedById(Object entityId, EntityType entityType) { validateEntityNotReferenced(entityId, entityType, getDefaultValueMap(entityType)); } 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 validateEntityNotReferencedById(Object entityId, EntityType entityType) { validateEntityNotReferenced(entityId, entityType, getDefaultValueMap(entityType)); } 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);  }