Search in sources :

Example 61 with Then

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));
}
Also used : AttributeType(com.vaticle.typedb.core.concept.type.AttributeType) Then(io.cucumber.java.en.Then)

Example 62 with Then

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;
    }
}
Also used : EntityType(com.vaticle.typedb.core.concept.type.EntityType) AttributeType(com.vaticle.typedb.core.concept.type.AttributeType) RelationType(com.vaticle.typedb.core.concept.type.RelationType) Then(io.cucumber.java.en.Then)

Example 63 with Then

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());
}
Also used : ThingType(com.vaticle.typedb.core.concept.type.ThingType) Then(io.cucumber.java.en.Then)

Example 64 with Then

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());
}
Also used : AttributeType(com.vaticle.typedb.core.concept.type.AttributeType) Then(io.cucumber.java.en.Then)

Example 65 with Then

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());
}
Also used : AttributeType(com.vaticle.typedb.core.concept.type.AttributeType) Then(io.cucumber.java.en.Then)

Aggregations

Then (io.cucumber.java.en.Then)124 SelenideElement (com.codeborne.selenide.SelenideElement)20 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)16 List (java.util.List)13 HashMap (java.util.HashMap)10 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)9 Map (java.util.Map)9 ThingType (com.vaticle.typedb.core.concept.type.ThingType)8 DataTable (io.cucumber.datatable.DataTable)8 When (io.cucumber.java.en.When)8 Pod (io.fabric8.kubernetes.api.model.Pod)8 Quantity (io.fabric8.kubernetes.api.model.Quantity)8 ArrayList (java.util.ArrayList)8 Date (java.util.Date)8 TimeoutException (java.util.concurrent.TimeoutException)8 TestUtils (io.syndesis.qe.utils.TestUtils)7 HTTPResponse (io.syndesis.qe.utils.http.HTTPResponse)7 OpenShiftWaitUtils (io.syndesis.qe.wait.OpenShiftWaitUtils)7 Slf4j (lombok.extern.slf4j.Slf4j)7 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)7