use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class GoogleCalendarSteps method updateEventInCalendarForUserWithValues.
@When("update event {string} in calendar {string} for user {string} with values")
public void updateEventInCalendarForUserWithValues(String eventSummary, String calendarName, String account, DataTable properties) throws Throwable {
String aliasedCalendarName = gcu.getAliasedCalendarName(calendarName);
String calendarId = gcu.getPreviouslyCreatedCalendar(account, aliasedCalendarName).getId();
Event e = gcu.getEventBySummary(account, calendarId, eventSummary);
if (e == null) {
throw new IllegalStateException(String.format("Looking for non-existent event %s in calendar %s", eventSummary, aliasedCalendarName));
}
for (List<String> list : properties.cells()) {
String key = list.get(0);
String value = list.get(1);
e.set(key, value);
}
gcu.updateEvent(account, calendarId, e);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class ConnectionsPublicApiSteps method updateConnectionProperties.
/**
* DataTable -> | property1 | value |
* | property2 | value |
*/
@When("^update properties of connection (\\w+)( and refresh integration)?$")
public void updateConnectionProperties(String connectionName, String refreshInt, DataTable tagsData) {
boolean refreshIntegrations = refreshInt != null;
List<List<String>> connectionProperties = tagsData.cells();
Properties properties = new Properties();
for (List<String> connectionProperty : connectionProperties) {
properties.put(connectionProperty.get(0), connectionProperty.get(1));
}
ConnectionOverview response = connectionsPublicEndpoint.updateConnectionProperties(connectionName, properties, refreshIntegrations);
for (List<String> connectionProperty : connectionProperties) {
assertThat(response.getConfiguredProperties()).containsEntry(connectionProperty.get(0), connectionProperty.get(1));
}
}
use of io.cucumber.java.en.When in project grakn by graknlabs.
the class TypeQLSteps method typeql_match.
@When("get answers of typeql match")
public void typeql_match(String typeQLQueryStatements) {
try {
TypeQLMatch typeQLQuery = TypeQL.parseQuery(String.join("\n", typeQLQueryStatements)).asMatch();
clearAnswers();
answers = tx().query().match(typeQLQuery).toList();
} catch (TypeQLException e) {
// NOTE: We manually close transaction here, because we want to align with all non-java clients,
// where parsing happens at server-side which closes transaction if they fail
tx().close();
throw e;
}
}
use of io.cucumber.java.en.When in project grakn by graknlabs.
the class TypeQLSteps method get_answers_of_typeql_insert.
@When("get answers of typeql insert")
public void get_answers_of_typeql_insert(String typeQLQueryStatements) {
TypeQLInsert typeQLQuery = TypeQL.parseQuery(String.join("\n", typeQLQueryStatements)).asInsert();
clearAnswers();
answers = tx().query().insert(typeQLQuery).toList();
}
use of io.cucumber.java.en.When in project grakn by graknlabs.
the class ThingTypeSteps method thing_type_unset_owns_key_type.
@When("{root_label}\\( ?{type_label} ?) unset owns key type: {type_label}")
public void thing_type_unset_owns_key_type(RootLabel rootLabel, String typeLabel, String attributeLabel) {
AttributeType attributeType = tx().concepts().getAttributeType(attributeLabel);
get_thing_type(rootLabel, typeLabel).unsetOwns(attributeType);
}
Aggregations