Search in sources :

Example 96 with When

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);
}
Also used : Event(com.google.api.services.calendar.model.Event) When(io.cucumber.java.en.When)

Example 97 with When

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));
    }
}
Also used : ConnectionOverview(io.syndesis.common.model.connection.ConnectionOverview) List(java.util.List) Properties(java.util.Properties) When(io.cucumber.java.en.When)

Example 98 with When

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;
    }
}
Also used : TypeQLException(com.vaticle.typeql.lang.common.exception.TypeQLException) TypeQLMatch(com.vaticle.typeql.lang.query.TypeQLMatch) When(io.cucumber.java.en.When)

Example 99 with When

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();
}
Also used : TypeQLInsert(com.vaticle.typeql.lang.query.TypeQLInsert) When(io.cucumber.java.en.When)

Example 100 with When

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

Aggregations

When (io.cucumber.java.en.When)111 SelenideElement (com.codeborne.selenide.SelenideElement)23 Map (java.util.Map)10 File (java.io.File)8 AttributeType (com.vaticle.typedb.core.concept.type.AttributeType)7 ModalDialogPage (io.syndesis.qe.pages.ModalDialogPage)7 Attribute (com.vaticle.typedb.core.concept.thing.Attribute)6 Account (io.syndesis.qe.account.Account)6 Form (io.syndesis.qe.fragments.common.form.Form)6 Syndesis (io.syndesis.qe.resource.impl.Syndesis)6 TimeoutException (java.util.concurrent.TimeoutException)6 RoleType (com.vaticle.typedb.core.concept.type.RoleType)5 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 Slf4j (lombok.extern.slf4j.Slf4j)5 ElementsCollection (com.codeborne.selenide.ElementsCollection)4 DataTable (io.cucumber.datatable.DataTable)4 IntegrationsEndpoint (io.syndesis.qe.endpoint.IntegrationsEndpoint)4 SyndesisRootPage (io.syndesis.qe.pages.SyndesisRootPage)4 List (java.util.List)4