use of io.cucumber.java.en.Then in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_set_owns_attribute_throws_exception.
@Then("{root_label}\\( ?{type_label} ?) set owns attribute type: {type_label}; throws exception")
public void thing_type_set_owns_attribute_throws_exception(RootLabel rootLabel, String typeLabel, String attributeLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attributeLabel);
assertThrows(() -> get_thing_type(rootLabel, typeLabel).setOwns(attributeType));
}
use of io.cucumber.java.en.Then in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_set_supertype_throws_exception.
@Then("{root_label}\\( ?{type_label} ?) set supertype: {type_label}; throws exception")
public void thing_type_set_supertype_throws_exception(RootLabel rootLabel, String typeLabel, String superLabel) {
switch(rootLabel) {
case ENTITY:
EntityType entitySuperType = tx().concepts().getEntityType(superLabel);
assertThrows(() -> tx().concepts().getEntityType(typeLabel).setSupertype(entitySuperType));
break;
case ATTRIBUTE:
AttributeType attributeSuperType = tx().concepts().getAttributeType(superLabel);
assertThrows(() -> tx().concepts().getAttributeType(typeLabel).setSupertype(attributeSuperType));
break;
case RELATION:
RelationType relationSuperType = tx().concepts().getRelationType(superLabel);
assertThrows(() -> tx().concepts().getRelationType(typeLabel).setSupertype(relationSuperType));
break;
}
}
use of io.cucumber.java.en.Then in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_get_supertype.
@Then("{root_label}\\( ?{type_label} ?) get supertype: {type_label}")
public void thing_type_get_supertype(RootLabel rootLabel, String typeLabel, String superLabel) {
ThingType supertype = get_thing_type(rootLabel, superLabel);
assertEquals(supertype, get_thing_type(rootLabel, typeLabel).getSupertype());
}
use of io.cucumber.java.en.Then in project grakn by graknlabs.
the class AttributeTypeSteps method attribute_type_as_value_type_does_not_have_any_regex.
@Then("attribute\\( ?{type_label} ?) as\\( ?{value_type} ?) does not have any regex")
public void attribute_type_as_value_type_does_not_have_any_regex(String typeLabel, AttributeType.ValueType valueType) {
if (!valueType.equals(AttributeType.ValueType.STRING))
fail();
AttributeType attributeType = attribute_type_as_value_type(typeLabel, valueType);
assertNull(attributeType.asString().getRegex());
}
use of io.cucumber.java.en.Then in project grakn by graknlabs.
the class AttributeTypeSteps method attribute_type_get_supertype_value_type.
@Then("attribute\\( ?{type_label} ?) get supertype value type: {value_type}")
public void attribute_type_get_supertype_value_type(String typeLabel, AttributeType.ValueType valueType) {
AttributeType supertype = tx().concepts().getAttributeType(typeLabel).getSupertype().asAttributeType();
assertEquals(valueType, supertype.getValueType());
}
Aggregations