use of io.cucumber.java.en.When in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_set_owns_key_type_as.
@When("{root_label}\\( ?{type_label} ?) set owns key type: {type_label} as {type_label}")
public void thing_type_set_owns_key_type_as(RootLabel rootLabel, String typeLabel, String attTypeLabel, String overriddenLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attTypeLabel);
AttributeType overriddenType = tx().concepts().getAttributeType(overriddenLabel);
get_thing_type(rootLabel, typeLabel).setOwns(attributeType, overriddenType, true);
}
use of io.cucumber.java.en.When in project grakn by graknlabs.
the class RelationSteps method relation_type_create_new_instance_with_key.
@When("{var} = relation\\( ?{type_label} ?) create new instance with key\\( ?{type_label} ?): {datetime}")
public void relation_type_create_new_instance_with_key(String var, String type, String keyType, LocalDateTime keyValue) {
Attribute.DateTime key = tx().concepts().getAttributeType(keyType).asDateTime().put(keyValue);
Relation relation = tx().concepts().getRelationType(type).create();
relation.setHas(key);
put(var, relation);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class OperatorValidationSteps method updateCustomResource.
@When("update CR with {string} file")
public void updateCustomResource(String file) {
Syndesis syndesis = ResourceFactory.get(Syndesis.class);
syndesis.editCr(getCrFromFileAsString(file));
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class DataMapperSteps method mapDataMapperStep.
@When("MAP using Step {int} and field {string} to {string}")
public void mapDataMapperStep(int fromStep, String fromField, String toField) {
DataMapperStepDefinition newDmStep = new DataMapperStepDefinition();
newDmStep.setFromStep(fromStep);
newDmStep.setInputFields(Collections.singletonList(fromField));
newDmStep.setOutputFields(Collections.singletonList(toField));
newDmStep.setMappingType(MappingType.MAP);
newDmStep.setStrategy(null);
super.getSteps().getLastStepDefinition().getDataMapperDefinition().getDataMapperStepDefinition().add(newDmStep);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class DataMapperSteps method separateDataMapperStep.
@When("SEPARATE using Step {int} and strategy {string} and source {string} into targets")
public void separateDataMapperStep(int fromStep, String strategy, String sourceField, DataTable targetMappingData) {
DataMapperStepDefinition newDmStep = new DataMapperStepDefinition();
newDmStep.setFromStep(fromStep);
newDmStep.setInputFields(Collections.singletonList(sourceField));
newDmStep.setOutputFields(targetMappingData.transpose().asList(String.class));
newDmStep.setMappingType(MappingType.SEPARATE);
newDmStep.setStrategy(SeparatorType.valueOf(strategy));
super.getSteps().getLastStepDefinition().getDataMapperDefinition().getDataMapperStepDefinition().add(newDmStep);
}
Aggregations