use of io.syndesis.common.model.connection.Connector 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);
}
use of io.syndesis.common.model.connection.Connector 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);
}
use of io.syndesis.common.model.connection.Connector 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);
}
use of io.syndesis.common.model.connection.Connector in project syndesis-qe by syndesisio.
the class DbSteps method createStartDbPeriodicProcedureStep.
@Then("^create start DB periodic stored procedure invocation action step named \"([^\"]*)\" and period \"([^\"]*)\" ms")
public void createStartDbPeriodicProcedureStep(String procedureName, Integer ms) {
final Connection dbConnection = connectionsEndpoint.get(getDbConnectionId());
final Connector dbConnector = connectorsEndpoint.get("sql");
final Action dbAction = TestUtils.findConnectorAction(dbConnector, "sql-stored-start-connector");
final Map<String, String> properties = TestUtils.map("procedureName", procedureName, "schedulerExpression", ms, "template", "add_lead(VARCHAR ${body[first_and_last_name]}, VARCHAR ${body[company]}, VARCHAR ${body[phone]}, VARCHAR ${body[email]}, " + "VARCHAR ${body[lead_source]}, VARCHAR ${body[lead_status]}, VARCHAR ${body[rating]})");
final ConnectorDescriptor connectorDescriptor = getConnectorDescriptor(dbAction, properties, dbConnection.getId().get());
final Step dbStep = new Step.Builder().stepKind(StepKind.endpoint).id(UUID.randomUUID().toString()).connection(dbConnection).action(generateStepAction(dbAction, connectorDescriptor)).configuredProperties(properties).build();
steps.getStepDefinitions().add(new StepDefinition(dbStep, connectorDescriptor));
}
use of io.syndesis.common.model.connection.Connector in project syndesis-qe by syndesisio.
the class DbSteps method createStartDbPeriodicSqlStep.
@Then("^create start DB periodic sql invocation action step with query \"([^\"]*)\" and period \"([^\"]*)\" ms")
public void createStartDbPeriodicSqlStep(String sqlQuery, Integer ms) {
final Connection dbConnection = connectionsEndpoint.get(getDbConnectionId());
final Connector dbConnector = connectorsEndpoint.get("sql");
final Action dbAction = TestUtils.findConnectorAction(dbConnector, "sql-start-connector");
final Map<String, String> properties = TestUtils.map("query", sqlQuery, "schedulerExpression", ms);
final ConnectorDescriptor connectorDescriptor = getConnectorDescriptor(dbAction, properties, dbConnection.getId().get());
// to be reported: period is not part of .json step (when checked via browser).
final Step dbStep = new Step.Builder().stepKind(StepKind.endpoint).id(UUID.randomUUID().toString()).connection(dbConnection).action(generateStepAction(dbAction, connectorDescriptor)).configuredProperties(properties).build();
steps.getStepDefinitions().add(new StepDefinition(dbStep, connectorDescriptor));
}
Aggregations