Search in sources :

Example 51 with Then

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

the class MonitoringValidationSteps method validateThatNumberOfAllMessagesOfIntegrationIsGreaterThanPeriodInMs.

@Then("validate that number of all messages through integration {string} is greater than {int}, period in ms: {int}")
public void validateThatNumberOfAllMessagesOfIntegrationIsGreaterThanPeriodInMs(String integrationName, int nr, int ms) {
    TestUtils.sleepIgnoreInterrupt(ms);
    IntegrationMetricsSummary summary = integrationUtils.getIntegrationMetrics(integrationName);
    assertThat(summary.getMessages()).isGreaterThan(nr);
}
Also used : IntegrationMetricsSummary(io.syndesis.common.model.metrics.IntegrationMetricsSummary) Then(io.cucumber.java.en.Then)

Example 52 with Then

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

the class OpenshiftValidationSteps method checkSar.

@Then("check that SAR check is disabled")
public void checkSar() {
    DeploymentConfig dc = OpenShiftUtils.getInstance().getDeploymentConfig("syndesis-oauthproxy");
    Optional<String> sarArg = dc.getSpec().getTemplate().getSpec().getContainers().get(0).getArgs().stream().filter(arg -> arg.contains("--openshift-sar")).findFirst();
    assertThat(sarArg).isNotPresent();
}
Also used : Quantity(io.fabric8.kubernetes.api.model.Quantity) Then(io.cucumber.java.en.Then) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) TimeoutException(java.util.concurrent.TimeoutException) Kafka(io.syndesis.qe.resource.impl.Kafka) HashMap(java.util.HashMap) StringUtils(org.apache.commons.lang3.StringUtils) ResourceRequirements(io.fabric8.kubernetes.api.model.ResourceRequirements) AMQ(io.syndesis.qe.resource.impl.AMQ) HTTPEndpoints(io.syndesis.qe.resource.impl.HTTPEndpoints) Given(io.cucumber.java.en.Given) Map(java.util.Map) Service(io.fabric8.kubernetes.api.model.Service) DataTable(io.cucumber.datatable.DataTable) MongoDb36(io.syndesis.qe.resource.impl.MongoDb36) TestConfiguration(io.syndesis.qe.TestConfiguration) InfraFail(io.syndesis.qe.test.InfraFail) When(io.cucumber.java.en.When) HorizontalPodAutoscalerBuilder(io.fabric8.kubernetes.api.model.HorizontalPodAutoscalerBuilder) Pod(io.fabric8.kubernetes.api.model.Pod) DeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig) OpenShiftUtils(io.syndesis.qe.utils.OpenShiftUtils) MySQL(io.syndesis.qe.resource.impl.MySQL) SFTP(io.syndesis.qe.resource.impl.SFTP) WildFlyS2i(io.syndesis.qe.resource.impl.WildFlyS2i) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) TestUtils(io.syndesis.qe.utils.TestUtils) ResourceFactory(io.syndesis.qe.resource.ResourceFactory) FTP(io.syndesis.qe.resource.impl.FTP) Kudu(io.syndesis.qe.resource.impl.Kudu) Optional(java.util.Optional) Deployment(io.fabric8.kubernetes.api.model.apps.Deployment) IRC(io.syndesis.qe.resource.impl.IRC) OpenShiftWaitUtils(io.syndesis.qe.wait.OpenShiftWaitUtils) DeploymentConfig(io.fabric8.openshift.api.model.DeploymentConfig) Then(io.cucumber.java.en.Then)

Example 53 with Then

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

the class SQSValidationSteps method verifyFifoReceivedMessages.

@Then("verify that {int} messages were received from AMQ {string} {string} and are in order")
public void verifyFifoReceivedMessages(int count, String destinationType, String name) {
    List<String> messages = new ArrayList<>();
    String m = JMSUtils.getMessageText(JMSUtils.Destination.valueOf(destinationType.toUpperCase()), name);
    messages.add(m);
    while (m != null) {
        m = JMSUtils.getMessageText(JMSUtils.Destination.valueOf(destinationType.toUpperCase()), name);
        if (m != null) {
            messages.add(m);
        }
    }
    assertThat(messages).hasSize(count);
    int lastMsgBody = 0;
    for (String message : messages) {
        assertThat(new JSONObject(message).getInt("body")).isEqualTo(lastMsgBody++);
    }
}
Also used : JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) Then(io.cucumber.java.en.Then)

Example 54 with Then

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

the class SfValidationSteps method createNewSalesforceLead.

@Then("create SF lead with first name: {string}, last name: {string}, email: {string} and company: {string}")
public void createNewSalesforceLead(String firstName, String lastName, String email, String companyName) {
    final Lead lead = new Lead();
    lead.setFirstName(firstName);
    lead.setLastName(lastName);
    lead.setCompany(companyName);
    lead.setEmail(email);
    leadId = SalesforceAccount.getInstance().createSObject("lead", lead);
    log.debug("Created lead with id " + leadId);
}
Also used : Lead(io.syndesis.qe.util.salesforce.Lead) Then(io.cucumber.java.en.Then)

Example 55 with Then

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

the class SfValidationSteps method updateLead.

@Then("update SF lead with email {string} to first name: {string}, last name {string}, email {string}, company name {string}")
public void updateLead(String origEmail, String newFirstName, String newLastName, String newEmailAddress, String companyName) {
    Optional<Lead> sfLead = getSalesforceLeadByEmail(origEmail);
    Assertions.assertThat(sfLead).isPresent();
    leadId = sfLead.get().getId();
    final Lead lead = new Lead();
    lead.setEmail(newEmailAddress);
    lead.setFirstName(newFirstName);
    lead.setLastName(newLastName);
    lead.setCompany(companyName);
    SalesforceAccount.getInstance().updateSObject("lead", leadId, lead);
}
Also used : Lead(io.syndesis.qe.util.salesforce.Lead) 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