use of ai.grakn.concept.Attribute in project grakn by graknlabs.
the class EntityTest method whenAddingResourceToEntityWithoutAllowingItBetweenTypes_Throw.
@Test
public void whenAddingResourceToEntityWithoutAllowingItBetweenTypes_Throw() {
EntityType entityType = tx.putEntityType("A Thing");
AttributeType<String> attributeType = tx.putAttributeType("A Attribute Thing", AttributeType.DataType.STRING);
Entity entity = entityType.addEntity();
Attribute attribute = attributeType.putAttribute("A attribute thing");
expectedException.expect(GraknTxOperationException.class);
expectedException.expectMessage(GraknTxOperationException.hasNotAllowed(entity, attribute).getMessage());
entity.attribute(attribute);
}
Aggregations