use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class GMailSteps method checkMailsFromCredentials.
@Then("^check that email from credenitals \"([^\"]*)\" with subject \"([^\"]*)\" and text \"([^\"]*)\" exists")
public void checkMailsFromCredentials(String credentials, String subject, String text) {
Account account = AccountsDirectory.getInstance().get(credentials);
String username = account.getProperty("username");
TestUtils.waitFor(() -> checkMailExists(username, subject, text), 1, 60, "Could not find specified mail");
}
use of io.syndesis.qe.account.Account 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.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class KafkaSteps method extractBrokerCertificate.
@Then("extract broker certificate")
public void extractBrokerCertificate() {
// 1. get string with values: (oc get secret my-cluster-kafka-brokers -o yaml > sec.log)
Secret secret = OpenShiftUtils.getInstance().getSecret("my-cluster-kafka-brokers");
String secrets = secret.toString();
// 2. extract values:
String cert = extractValue("crt", secrets);
// 3. put values into account:
Account kafkaTlsAccount = AccountsDirectory.getInstance().get("kafka-autodetect-tls");
Map<String, String> kafkaAutodetectTlsParameters = kafkaTlsAccount.getProperties();
kafkaAutodetectTlsParameters.put("brokercertificate", cert);
kafkaTlsAccount.setProperties(kafkaAutodetectTlsParameters);
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class KafkaSteps method createdKafkaConnectionUsingAMQStreamsAutoDetection.
// this method is preliminary, since auto-detection dropdown doesn't have data-testid yet and
// thus does not fit ...fillConnectionDetails(...) method of CommonSteps.createConnections()
@Given("created Kafka connection using AMQ streams auto detection using \"([^\"]*)\" security$")
public void createdKafkaConnectionUsingAMQStreamsAutoDetection(String securityMode, DataTable connectionsData) {
final List<List<String>> dataTable = connectionsData.cells();
final List<String> dataRow = dataTable.get(0);
String connectionType = dataRow.get(0);
String connectionName = dataRow.get(2);
String description = dataRow.get(3);
Account kafkaAccount = AccountsDirectory.getInstance().get("kafka-autodetect-" + securityMode.toLowerCase());
commonSteps.navigateTo("Connections");
commonSteps.validatePage("Connections");
ElementsCollection connections = connectionsPage.getAllConnections();
connections = connections.filter(exactText(connectionName));
assertThat(connections.isEmpty()).isTrue();
commonSteps.clickOnLink("Create Connection");
TestUtils.sleepIgnoreInterrupt(TestConfiguration.getJenkinsDelay() * 1000);
selectConnectionTypeSteps.selectConnectionType(connectionType);
// select autodiscovered broker url:
commonSteps.clickOnButtonByCssClassName("pf-c-select__toggle-button");
commonSteps.clickOnButton(kafkaAccount.getProperty("brokers"));
commonSteps.selectsFromDropdown(kafkaAccount.getProperty("transportprotocol"), "transportprotocol");
if ("TLS".equals(securityMode)) {
$(ByUtils.dataTestId("brokercertificate")).shouldBe(visible).sendKeys(kafkaAccount.getProperty("brokercertificate"));
}
commonSteps.clickOnButton("Validate");
commonSteps.successNotificationIsPresentWithError(connectionType + " has been successfully validated", "success");
commonSteps.scrollTo("top", "right");
commonSteps.clickOnButton("Next");
// next page:
nameConnectionSteps.setConnectionName(connectionName);
nameConnectionSteps.setConnectionDescription(description);
commonSteps.clickOnButton("Save");
}
use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.
the class ODataSteps method resetODataV2Service.
@Then("^.*reset OData v2 service$")
public void resetODataV2Service() throws IOException {
log.info("Reseting odata service by getting new user token");
OkHttpClient client = new OkHttpClient.Builder().followRedirects(false).build();
Response response = client.newCall(new Request.Builder().url(ODataUtils.getV2ResetUrl()).get().build()).execute();
assertThat(response.code()).isEqualTo(302);
String location = response.headers().get("Location");
if (location != null) {
String newUrl = ODataUtils.getV2BaseUrl() + location;
Account a = AccountsDirectory.getInstance().get("odata V2");
Map<String, String> properties = Collections.singletonMap("serviceUri", newUrl);
a.setProperties(properties);
log.info("new OData V2 URL is {}", newUrl);
}
response.close();
}
Aggregations