use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class IntermediateSteps method addSplitStep.
@When("add a split step")
public void addSplitStep() {
final DataShape in = super.getSteps().getLastStepDefinition().getStep().getAction().get().getInputDataShape().get();
final DataShape out = super.getSteps().getLastStepDefinition().getStep().getAction().get().getOutputDataShape().get();
StepDescriptor sd = stepDescriptorEndpoint.getStepDescriptor("split", in, out);
super.addProperty(StepProperty.KIND, StepKind.split);
super.addProperty(StepProperty.ACTION, super.generateStepAction(super.getSteps().getLastStepDefinition().getStep().getAction().get(), sd));
super.addProperty(StepProperty.STEP_NAME, "Split");
super.createStep();
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class IntermediateSteps method addAggregateStep.
@When("add an aggregate step")
public void addAggregateStep() {
Step previousStepWithDatashapes = null;
for (int i = super.getSteps().getSteps().size() - 1; i >= 0; i--) {
Step s = super.getSteps().getSteps().get(i);
if (s.getAction().isPresent() && s.getAction().get().getInputDataShape().isPresent() && s.getAction().get().getOutputDataShape().isPresent()) {
previousStepWithDatashapes = super.getSteps().getSteps().get(i);
break;
}
}
if (previousStepWithDatashapes == null) {
fail("Unable to find previous step with both datashapes set");
}
StepDescriptor sd = stepDescriptorEndpoint.getStepDescriptor("aggregate", previousStepWithDatashapes.getAction().get().getInputDataShape().get(), previousStepWithDatashapes.getAction().get().getOutputDataShape().get());
super.addProperty(StepProperty.KIND, StepKind.aggregate);
super.addProperty(StepProperty.ACTION, super.generateStepAction(previousStepWithDatashapes.getAction().get(), sd));
super.addProperty(StepProperty.STEP_NAME, "Aggregate");
super.createStep();
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class IntegrationStateHandler method rebuildIntegration.
@When("rebuild integration with name {string}")
public void rebuildIntegration(String name) {
Optional<String> integrationId = integrationsEndpoint.getIntegrationId(name);
if (!integrationId.isPresent()) {
InfraFail.fail("Unable to find ID for flow " + name);
}
final int currentNo = OpenShiftUtils.extractPodSequenceNr(OpenShiftUtils.getIntegrationPod(name, p -> p.getMetadata().getName().endsWith("-build")));
integrationsEndpoint.activateIntegration(integrationId.get());
try {
OpenShiftWaitUtils.waitFor(() -> OpenShiftUtils.integrationPodExists(name, p -> p.getMetadata().getName().endsWith("build"), p -> OpenShiftUtils.extractPodSequenceNr(p) > currentNo), 10000L, 60000L);
} catch (TimeoutException | InterruptedException e) {
InfraFail.fail("Unable to find new build pod for integration " + name + "after 60 seconds");
}
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class GMailSteps method sendEmailToCreds.
@When("^.*send an e-mail to credentials \"([^\"]*)\" with subject \"([^\"]*)\"$")
public void sendEmailToCreds(String credentials, String subject) {
Account account = AccountsDirectory.getInstance().get(credentials);
sendEmail(account.getProperty("username"), subject);
}
use of io.cucumber.java.en.When in project syndesis-qe by syndesisio.
the class JiraSteps method commentIssue.
@When("comment previously created jira issue with text \"([^\"]*)\"")
public void commentIssue(String text) {
Issue issue = jiraRestClient.getIssueClient().getIssue(sharedIssueKey).claim();
jiraRestClient.getIssueClient().addComment(issue.getCommentsUri(), Comment.valueOf(text)).claim();
}
Aggregations