Search in sources :

Example 36 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class SampleDbConnectionManager method createDbConnection.

private static Connection createDbConnection(String dbType) {
    final Properties props = new Properties();
    Account account = AccountsDirectory.getInstance().get(dbType);
    props.setProperty("user", account.getProperty("user"));
    props.setProperty("password", account.getProperty("password"));
    String dbUrl = account.getProperties().get("url");
    log.debug("DB endpoint URL: *{}*", dbUrl);
    try {
        return DriverManager.getConnection(dbUrl, props);
    } catch (SQLException e) {
        fail("Error creating DB connection.", e);
    }
    return null;
}
Also used : Account(io.syndesis.qe.account.Account) SQLException(java.sql.SQLException) Properties(java.util.Properties)

Example 37 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class MqttUtils method createReceiver.

public MqttClient createReceiver(String clientName, String topic) throws MqttException {
    MqttClient sampleClient = new MqttClient(BROKER, clientName, new MemoryPersistence());
    MqttConnectOptions connOpts = new MqttConnectOptions();
    connOpts.setCleanSession(false);
    Account account = AccountsDirectory.getInstance().get(Account.Name.MQTT);
    connOpts.setUserName(account.getProperties().get("userName"));
    connOpts.setPassword(account.getProperties().get("password").toCharArray());
    sampleClient.connect(connOpts);
    sampleClient.subscribe(topic, 1);
    sampleClient.setCallback(new Receiver(clientName));
    return sampleClient;
}
Also used : MqttClient(org.eclipse.paho.client.mqttv3.MqttClient) Account(io.syndesis.qe.account.Account) MemoryPersistence(org.eclipse.paho.client.mqttv3.persist.MemoryPersistence) MqttConnectOptions(org.eclipse.paho.client.mqttv3.MqttConnectOptions)

Example 38 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class FhirClientManager method initProperties.

private void initProperties() {
    Account account = AccountsDirectory.getInstance().get(Account.Name.FHIR);
    Map<String, String> properties = new HashMap<>();
    account.getProperties().forEach((key, value) -> properties.put(key.toLowerCase(), value));
    fhirPodName = properties.get("host");
    fhirRemotePort = Integer.parseInt(properties.get("port"));
    fhirServerLocalUrl = "http://localhost:" + fhirLocalPort + "/baseDstu3";
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap)

Example 39 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class WildFlyS2i method createODataV4Account.

public void createODataV4Account(boolean https) {
    Account oData = new Account();
    oData.setService("OData");
    Map<String, String> properties = new HashMap<>();
    String serviceUri;
    String key;
    if (https) {
        serviceUri = "https://services.odata.org/TripPinRESTierService/";
        key = "odataHttps";
    } else {
        serviceUri = ODataUtils.getOpenshiftService();
        key = "odata V4";
    }
    properties.put("serviceUri", serviceUri);
    oData.setProperties(properties);
    AccountsDirectory.getInstance().addAccount(key, oData);
    log.info("Created new Account: {}", key);
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap)

Example 40 with Account

use of io.syndesis.qe.account.Account in project syndesis-qe by syndesisio.

the class SNSUtils method getTopicArn.

/**
 * Gets the ARN of the given topic.
 *
 * @param topic topic name
 * @return topic ARN
 */
public static String getTopicArn(String topic) {
    final Account sqs = AccountsDirectory.getInstance().get(Account.Name.AWS);
    final String region = sqs.getProperty("region").toLowerCase().replaceAll("_", "-");
    final String accountId = sqs.getProperty("accountId");
    return String.format("arn:aws:sns:%s:%s:%s", region, accountId, topic);
}
Also used : Account(io.syndesis.qe.account.Account)

Aggregations

Account (io.syndesis.qe.account.Account)51 HashMap (java.util.HashMap)21 GoogleAccount (io.syndesis.qe.utils.google.GoogleAccount)10 IntOrString (io.fabric8.kubernetes.api.model.IntOrString)9 Then (io.cucumber.java.en.Then)6 When (io.cucumber.java.en.When)6 Given (io.cucumber.java.en.Given)5 ArrayList (java.util.ArrayList)5 TimeoutException (java.util.concurrent.TimeoutException)5 List (java.util.List)4 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 Form (io.syndesis.qe.fragments.common.form.Form)3 AsynchronousJiraRestClientFactory (com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory)2 SelenideElement (com.codeborne.selenide.SelenideElement)2 ElementNotFound (com.codeborne.selenide.ex.ElementNotFound)2 DataTable (io.cucumber.datatable.DataTable)2 ContainerPort (io.fabric8.kubernetes.api.model.ContainerPort)2 ContainerPortBuilder (io.fabric8.kubernetes.api.model.ContainerPortBuilder)2 EnvVar (io.fabric8.kubernetes.api.model.EnvVar)2 ServicePortBuilder (io.fabric8.kubernetes.api.model.ServicePortBuilder)2