Search in sources :

Example 91 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class ConfigureStepSteps method setFtpDownloadData.

@When("^fill in ftp download form with values$")
public void setFtpDownloadData(DataTable sourceMappingData) {
    List<Map<String, String>> maps = sourceMappingData.asMaps(String.class, String.class);
    for (Map<String, String> source : maps) {
        for (String field : source.keySet()) {
            SelenideElement element = ftpDownload.checkAndGetFieldTypeByName(field);
            assertThat(element).isNotNull();
            ftpDownload.setElementValue(source.get(field), element);
        }
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) Map(java.util.Map) When(io.cucumber.java.en.When)

Example 92 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class ConfigureStepSteps method setJmsRequestData.

@When("^sets jms request inputs source data$")
public void setJmsRequestData(DataTable sourceMappingData) {
    List<Map<String, String>> maps = sourceMappingData.asMaps(String.class, String.class);
    for (Map<String, String> source : maps) {
        for (String field : source.keySet()) {
            // shouldn't be here jmsRequest class used??
            SelenideElement element = jmsSubscribe.checkAndGetFieldTypeById(field);
            assertThat(element).isNotNull();
            jmsSubscribe.setElementValue(source.get(field), element);
        }
    }
}
Also used : SelenideElement(com.codeborne.selenide.SelenideElement) Map(java.util.Map) When(io.cucumber.java.en.When)

Example 93 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class FhirValidationSteps method createBasicWithLanguageOnFHIRAndDB.

// entity - BASIC:
@When("create basic with language {string} on FHIR and put it into DB")
public void createBasicWithLanguageOnFHIRAndDB(String lang) {
    String basicId = fhirUtils.insertBasicToFhir(lang);
    MyBasicSpecification bs = new MyBasicSpecification(lang, basicId);
    DataTable dt = prepareDataTable(bs);
    dbValidationSteps.insertsIntoTable("TODO WITH ID", dt);
}
Also used : DataTable(io.cucumber.datatable.DataTable) MyBasicSpecification(io.syndesis.qe.util.fhir.MyBasicSpecification) When(io.cucumber.java.en.When)

Example 94 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class HTTPValidationSteps method sendGetRequestUsingAndPath.

@When("send get request using {string} and {string} path")
public void sendGetRequestUsingAndPath(String account, String path) {
    final Account a = AccountsDirectory.getInstance().get(account);
    HTTPUtils.doGetRequest(a.getProperty("baseUrl") + path);
}
Also used : Account(io.syndesis.qe.account.Account) When(io.cucumber.java.en.When)

Example 95 with When

use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.

the class HTTPValidationSteps method configureKeystore.

@When("^configure keystore in (HTTP|HTTPS) integration dc$")
public void configureKeystore(String protocol) {
    if ("HTTP".equals(protocol)) {
        return;
    }
    try {
        OpenShiftWaitUtils.waitFor(() -> !OpenShiftUtils.getInstance().deploymentConfigs().withLabel("syndesis.io/type", "integration").list().getItems().isEmpty(), 300000L);
    } catch (TimeoutException | InterruptedException e) {
        fail("Unable to find integration deployment config after 5 minutes");
    } catch (Exception e) {
    // ignore
    }
    List<DeploymentConfig> integrationDcs = OpenShiftUtils.getInstance().deploymentConfigs().withLabel("syndesis.io/type", "integration").list().getItems();
    Assertions.assertThat(integrationDcs).as("There should be only one integration deployment config").hasSize(1);
    DeploymentConfig dc = integrationDcs.get(0);
    log.debug("Waiting until next integration state check interval");
    String serverLog = OpenShiftUtils.getPodLogs("syndesis-server");
    while (serverLog.equals(OpenShiftUtils.getPodLogs("syndesis-server"))) {
        TestUtils.sleepIgnoreInterrupt(5000L);
    }
    TestUtils.withRetry(() -> {
        try {
            // @formatter:off
            OpenShiftUtils.getInstance().deploymentConfigs().withName(dc.getMetadata().getName()).edit().editSpec().editTemplate().editSpec().addNewVolume().withName("keystore").withNewSecret().withSecretName(HTTPEndpoints.KEYSTORE_SECRET_NAME).endSecret().endVolume().editFirstContainer().addNewVolumeMount().withNewMountPath("/opt/jboss/").withName("keystore").endVolumeMount().addToEnv(new EnvVar("JAVA_OPTIONS", "-Djackson.deserialization.whitelist.packages=io.syndesis.common.model,io.atlasmap" + " -Djavax.net.ssl.trustStore=/opt/jboss/keystore.p12 -Djavax.net.ssl.trustStorePassword=tomcat -Djavax.net.ssl.trustStoreAlias=tomcat", null)).endContainer().endSpec().endTemplate().endSpec().done();
            // @formatter:on
            // Just to be sure, delete the integration pod if it exists, so that the change in DC is picked up
            OpenShiftUtils.getInstance().deletePods("syndesis.io/type", "integration");
            return true;
        } catch (KubernetesClientException kce) {
            log.debug("Caught KubernetesClientException: ", kce);
            return false;
        }
    }, 3, 30000L, "Unable to edit deployment config");
}
Also used : EnvVar(io.fabric8.kubernetes.api.model.EnvVar) DeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig) KubernetesClientException(io.fabric8.kubernetes.client.KubernetesClientException) TimeoutException(java.util.concurrent.TimeoutException) TimeoutException(java.util.concurrent.TimeoutException) KubernetesClientException(io.fabric8.kubernetes.client.KubernetesClientException) 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