Search in sources :

Example 1 with Account

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

the class ConnectionsGeneralSteps method createTwitterConnection.

@Given("^create the TW connection using \"([^\"]*)\" template")
public void createTwitterConnection(String twitterTemplate) {
    final Connector twitterConnector = connectorsEndpoint.get("twitter");
    final Account twitterAccount = accountsDirectory.getAccount(twitterTemplate).get();
    log.info("Template name:  {}", twitterTemplate);
    final Connection twitterConnection = new Connection.Builder().connector(twitterConnector).connectorId(getConnectorId(twitterConnector)).id(RestConstants.getInstance().getTWITTER_CONNECTION_ID()).name("New Fuse QE twitter listen").configuredProperties(TestUtils.map("accessToken", twitterAccount.getProperty("accessToken"), "accessTokenSecret", twitterAccount.getProperty("accessTokenSecret"), "consumerKey", twitterAccount.getProperty("consumerKey"), "consumerSecret", twitterAccount.getProperty("consumerSecret"))).icon("fa-twitter").tags(Arrays.asList("twitter")).build();
    log.info("Creating twitter connection {}", twitterConnection.getName());
    connectionsEndpoint.create(twitterConnection);
}
Also used : Connector(io.syndesis.common.model.connection.Connector) Account(io.syndesis.qe.accounts.Account) S3BucketNameBuilder(io.syndesis.qe.utils.S3BucketNameBuilder) Connection(io.syndesis.common.model.connection.Connection) Given(cucumber.api.java.en.Given)

Example 2 with Account

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

the class ConnectionsGeneralSteps method createFtpConnection.

@Given("^create the FTP connection using \"([^\"]*)\" template")
public void createFtpConnection(String ftpTemplate) {
    connectionsEndpoint.list().forEach(c -> log.info(c.getName()));
    final Connector ftpConnector = connectorsEndpoint.get("ftp");
    final Account ftpAccount = accountsDirectory.getAccount(ftpTemplate).get();
    log.info("Template name:  {}", ftpTemplate);
    final Connection ftpConnection = new Connection.Builder().connector(ftpConnector).connectorId(getConnectorId(ftpConnector)).id(RestConstants.getInstance().getFTP_CONNECTION_ID()).name("New Fuse QE FTP").configuredProperties(TestUtils.map(// "disconnect", ftpAccount.getProperty("disconnect"),
    "host", ftpAccount.getProperty("host"), // "password", ftpAccount.getProperty("password"),
    "port", ftpAccount.getProperty("port"))).icon("fa-ftp").tags(Arrays.asList("ftp")).build();
    log.info("Creating ftp connection {}", ftpConnection.getName());
    connectionsEndpoint.create(ftpConnection);
}
Also used : Connector(io.syndesis.common.model.connection.Connector) Account(io.syndesis.qe.accounts.Account) S3BucketNameBuilder(io.syndesis.qe.utils.S3BucketNameBuilder) Connection(io.syndesis.common.model.connection.Connection) Given(cucumber.api.java.en.Given)

Example 3 with Account

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

the class ConnectionsGeneralSteps method createSalesforceConnection.

@Given("^create SF connection")
public void createSalesforceConnection() {
    final Account salesforceAccount = accountsDirectory.getAccount("salesforce").get();
    final Connector salesforceConnector = connectorsEndpoint.get("salesforce");
    final Connection salesforceConnection = new Connection.Builder().connector(salesforceConnector).connectorId(getConnectorId(salesforceConnector)).id(RestConstants.getInstance().getSALESFORCE_CONNECTION_ID()).icon("fa-puzzle-piece").name("New Fuse QE salesforce").configuredProperties(TestUtils.map("clientId", salesforceAccount.getProperty("clientId"), "clientSecret", salesforceAccount.getProperty("clientSecret"), "loginUrl", salesforceAccount.getProperty("loginUrl"), "userName", salesforceAccount.getProperty("userName"), "password", salesforceAccount.getProperty("password"))).tags(Arrays.asList("salesforce")).build();
    log.info("Creating salesforce connection {}", salesforceConnection.getName());
    connectionsEndpoint.create(salesforceConnection);
}
Also used : Account(io.syndesis.qe.accounts.Account) Connector(io.syndesis.common.model.connection.Connector) S3BucketNameBuilder(io.syndesis.qe.utils.S3BucketNameBuilder) Connection(io.syndesis.common.model.connection.Connection) Given(cucumber.api.java.en.Given)

Example 4 with Account

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

the class AmqTemplate method addAccounts.

private static void addAccounts() {
    Account openwireAccount = new Account();
    Map<String, String> openwireAccountParameters = new HashMap<>();
    openwireAccountParameters.put("username", "amq");
    openwireAccountParameters.put("password", "topSecret");
    openwireAccountParameters.put("brokerUrl", "tcp://broker-amq:61616");
    // openwireAccountParameters.put("clientID", UUID.randomUUID().toString());
    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://broker-amq:5672");
    amqpAccountParameters.put("clientID", UUID.randomUUID().toString());
    amqpAccountParameters.put("skipCertificateCheck", "Disable");
    amqpAccountParameters.put("brokerCertificate", "");
    amqpAccountParameters.put("clientCertificate", "");
    amqpAccount.setService("amqp");
    amqpAccount.setProperties(amqpAccountParameters);
    AccountsDirectory.getInstance().addAccount("AMQ", openwireAccount);
    AccountsDirectory.getInstance().addAccount("AMQP", amqpAccount);
}
Also used : Account(io.syndesis.qe.accounts.Account) HashMap(java.util.HashMap)

Example 5 with Account

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

the class DropBoxUtils method getClient.

private DbxClientV2 getClient() throws DbxException {
    if (this.client == null) {
        Optional<Account> optional = AccountsDirectory.getInstance().getAccount("QE Dropbox");
        if (optional.isPresent()) {
            DbxRequestConfig config = new DbxRequestConfig(optional.get().getProperty("clientIdentifier"));
            this.client = new DbxClientV2(config, optional.get().getProperty("accessToken"));
        } else {
            log.error("Unable to create DropBox client - credentials not found.");
            throw new IllegalArgumentException("DropBox credentials were not found.");
        }
        log.debug("DropBox client created, logged as: " + client.users().getCurrentAccount());
    } else {
        log.debug("DropBox client was already created, returning existing instance");
    }
    return this.client;
}
Also used : Account(io.syndesis.qe.accounts.Account) DbxClientV2(com.dropbox.core.v2.DbxClientV2) DbxRequestConfig(com.dropbox.core.DbxRequestConfig)

Aggregations

Account (io.syndesis.qe.accounts.Account)8 Given (cucumber.api.java.en.Given)4 Connection (io.syndesis.common.model.connection.Connection)4 Connector (io.syndesis.common.model.connection.Connector)4 S3BucketNameBuilder (io.syndesis.qe.utils.S3BucketNameBuilder)4 HashMap (java.util.HashMap)2 DbxRequestConfig (com.dropbox.core.DbxRequestConfig)1 DbxClientV2 (com.dropbox.core.v2.DbxClientV2)1 DataTable (cucumber.api.DataTable)1 And (cucumber.api.java.en.And)1 ContainerPort (io.fabric8.kubernetes.api.model.ContainerPort)1 ContainerPortBuilder (io.fabric8.kubernetes.api.model.ContainerPortBuilder)1 IntOrString (io.fabric8.kubernetes.api.model.IntOrString)1 ServicePortBuilder (io.fabric8.kubernetes.api.model.ServicePortBuilder)1 ServiceSpecBuilder (io.fabric8.kubernetes.api.model.ServiceSpecBuilder)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 TimeoutException (java.util.concurrent.TimeoutException)1