Search in sources :

Example 46 with Account

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

the class AMQ method addAccounts.

public void addAccounts() {
    // account to use broker-amq instead of syndesis-amq. It is uses in AMQ-TO-REST test
    Account amqProdAccount = new Account();
    Map<String, String> amqProdAccountParameters = new HashMap<>();
    amqProdAccountParameters.put("username", "amq");
    amqProdAccountParameters.put("password", "topSecret");
    amqProdAccountParameters.put("brokerUrl", "tcp://broker-amq-tcp:61616");
    amqProdAccount.setService("amq");
    amqProdAccount.setProperties(amqProdAccountParameters);
    Account openwireAccount = new Account();
    Map<String, String> openwireAccountParameters = new HashMap<>();
    openwireAccountParameters.put("username", "amq");
    openwireAccountParameters.put("password", "topSecret");
    openwireAccountParameters.put("brokerUrl", "tcp://syndesis-amq-tcp:61616");
    openwireAccount.setService("amq");
    openwireAccount.setProperties(openwireAccountParameters);
    Account amqpAccount = new Account();
    Map<String, String> amqpAccountParameters = new HashMap<>();
    amqpAccountParameters.put("username", "amq");
    amqpAccountParameters.put("password", "topSecret");
    amqpAccountParameters.put("connectionUri", "amqp://syndesis-amq-tcp:5672");
    amqpAccountParameters.put("clientID", UUID.randomUUID().toString());
    amqpAccountParameters.put("skipCertificateCheck", "Disable");
    amqpAccountParameters.put("brokerCertificate", "");
    amqpAccountParameters.put("clientCertificate", "");
    amqpAccount.setService("amqp");
    amqpAccount.setProperties(amqpAccountParameters);
    Account mqttAccount = new Account();
    Map<String, String> mqttAccountParameters = new HashMap<>();
    mqttAccountParameters.put("userName", "amq");
    mqttAccountParameters.put("password", "topSecret");
    mqttAccountParameters.put("brokerUrl", "tcp://syndesis-amq-tcp:1883");
    mqttAccount.setService("MQTT");
    mqttAccount.setProperties(mqttAccountParameters);
    AccountsDirectory.getInstance().addAccount("AMQ_PROD", amqProdAccount);
    AccountsDirectory.getInstance().addAccount("AMQ", openwireAccount);
    AccountsDirectory.getInstance().addAccount("AMQP", amqpAccount);
    AccountsDirectory.getInstance().addAccount("QE MQTT", mqttAccount);
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap)

Example 47 with Account

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

the class FTP method initProperties.

private void initProperties() {
    Account account = AccountsDirectory.getInstance().get(Account.Name.FTP);
    Map<String, String> properties = new HashMap<>();
    account.getProperties().forEach((key, value) -> properties.put(key.toLowerCase(), value));
    appName = properties.get("host");
    ftpCommandPort = Integer.parseInt(properties.get("port"));
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap) IntOrString(io.fabric8.kubernetes.api.model.IntOrString)

Example 48 with Account

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

the class MongoDb36 method addAccount.

public void addAccount() {
    Account mongodbAccount = new Account();
    mongodbAccount.setService("mongodb36");
    Map<String, String> accountParameters = new HashMap<>();
    accountParameters.put("host", APP_NAME);
    accountParameters.put("user", MONGODB_USER);
    accountParameters.put("password", MONGODB_PASSWORD);
    accountParameters.put("database", MONGODB_DATABASE);
    // this does not work for now
    // accountParameters.put("admindb", MONGODB_DATABASE);
    accountParameters.put("url", MONGDB_URL);
    mongodbAccount.setProperties(accountParameters);
    AccountsDirectory.getInstance().addAccount(Account.Name.MONGODB36.getId(), mongodbAccount);
}
Also used : Account(io.syndesis.qe.account.Account) HashMap(java.util.HashMap) IntOrString(io.fabric8.kubernetes.api.model.IntOrString)

Example 49 with Account

use of io.syndesis.qe.account.Account 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);
}
Also used : Account(io.syndesis.qe.account.Account) When(io.cucumber.java.en.When)

Example 50 with Account

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

the class SalesforceAccount method getInstance.

public static ForceApi getInstance() {
    if (salesforce == null) {
        final Account salesforceAccount = AccountsDirectory.getInstance().get(Account.Name.SALESFORCE);
        TestUtils.withRetry(() -> {
            try {
                salesforce = new ForceApi(new ApiConfig().setClientId(salesforceAccount.getProperty("clientId")).setClientSecret(salesforceAccount.getProperty("clientSecret")).setUsername(salesforceAccount.getProperty("userName")).setPassword(salesforceAccount.getProperty("password")).setForceURL(salesforceAccount.getProperty("loginUrl")));
                return true;
            } catch (Exception ex) {
                log.error("Unable to connect to salesforce, will retry in 5 minutes");
                return false;
            }
        }, 3, 300000L, "Unable to connect to SalesForce");
    }
    return salesforce;
}
Also used : Account(io.syndesis.qe.account.Account) ApiConfig(com.force.api.ApiConfig) ForceApi(com.force.api.ForceApi)

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