Search in sources :

Example 1 with Connector

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);
}
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 Connector

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);
}
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 Connector

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);
}
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 Connector

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));
}
Also used : Connector(io.syndesis.common.model.connection.Connector) ConnectorDescriptor(io.syndesis.common.model.action.ConnectorDescriptor) Action(io.syndesis.common.model.action.Action) Connection(io.syndesis.common.model.connection.Connection) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) Step(io.syndesis.common.model.integration.Step) AbstractStep(io.syndesis.qe.bdd.AbstractStep) Then(cucumber.api.java.en.Then)

Example 5 with Connector

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));
}
Also used : Connector(io.syndesis.common.model.connection.Connector) ConnectorDescriptor(io.syndesis.common.model.action.ConnectorDescriptor) Action(io.syndesis.common.model.action.Action) Connection(io.syndesis.common.model.connection.Connection) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) Step(io.syndesis.common.model.integration.Step) AbstractStep(io.syndesis.qe.bdd.AbstractStep) Then(cucumber.api.java.en.Then)

Aggregations

Connection (io.syndesis.common.model.connection.Connection)16 Connector (io.syndesis.common.model.connection.Connector)16 Step (io.syndesis.common.model.integration.Step)12 StepDefinition (io.syndesis.qe.bdd.entities.StepDefinition)12 Given (cucumber.api.java.en.Given)10 Action (io.syndesis.common.model.action.Action)10 ConnectorDescriptor (io.syndesis.common.model.action.ConnectorDescriptor)10 AbstractStep (io.syndesis.qe.bdd.AbstractStep)9 S3BucketNameBuilder (io.syndesis.qe.utils.S3BucketNameBuilder)5 Account (io.syndesis.qe.accounts.Account)4 And (cucumber.api.java.en.And)3 Then (cucumber.api.java.en.Then)3 MappingType (io.atlasmap.v2.MappingType)1 Integration (io.syndesis.common.model.integration.Integration)1 StepKind (io.syndesis.common.model.integration.StepKind)1 AtlasMapperGenerator (io.syndesis.qe.bdd.datamapper.AtlasMapperGenerator)1 DataMapperDefinition (io.syndesis.qe.bdd.entities.DataMapperDefinition)1 DataMapperStepDefinition (io.syndesis.qe.bdd.entities.DataMapperStepDefinition)1 StepsStorage (io.syndesis.qe.bdd.storage.StepsStorage)1 ConnectionsEndpoint (io.syndesis.qe.endpoints.ConnectionsEndpoint)1