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);
}
}
}
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);
}
}
}
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);
}
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);
}
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");
}
Aggregations