Search in sources :

Example 1 with StepDefinition

use of io.syndesis.qe.bdd.entities.StepDefinition in project syndesis-qe by syndesisio.

the class DataMapperStep method startMapperDefinition.

/**
 * Just creates mapper step definition, the mapper will be generated on the integration creation.
 *
 * @param mapperName
 */
@And("start mapper definition with name: \"([^\"]*)\"")
public void startMapperDefinition(String mapperName) {
    final Step mapperStep = new Step.Builder().stepKind(StepKind.mapper).name(mapperName).build();
    steps.getStepDefinitions().add(new StepDefinition(mapperStep, new DataMapperDefinition()));
}
Also used : DataMapperDefinition(io.syndesis.qe.bdd.entities.DataMapperDefinition) DataMapperStepDefinition(io.syndesis.qe.bdd.entities.DataMapperStepDefinition) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) Step(io.syndesis.common.model.integration.Step) And(cucumber.api.java.en.And)

Example 2 with StepDefinition

use of io.syndesis.qe.bdd.entities.StepDefinition 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 3 with StepDefinition

use of io.syndesis.qe.bdd.entities.StepDefinition 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)

Example 4 with StepDefinition

use of io.syndesis.qe.bdd.entities.StepDefinition in project syndesis-qe by syndesisio.

the class FtpSteps method setFtpUploadData.

@And("^creates finish FTP upload action with values$")
public void setFtpUploadData(DataTable sourceMappingData) {
    final Connection ftpConnection = connectionsEndpoint.get(RestConstants.getFTP_CONNECTION_ID());
    final Connector ftpConnector = connectorsEndpoint.get("ftp");
    Map<String, String> dataMap = sourceMappingData.asMaps(String.class, String.class).get(0);
    final Step ftpStep = new Step.Builder().stepKind(StepKind.endpoint).connection(ftpConnection).id(UUID.randomUUID().toString()).action(TestUtils.findConnectorAction(ftpConnector, "io.syndesis:ftp-upload-connector")).configuredProperties(dataMap).build();
    steps.getStepDefinitions().add(new StepDefinition(ftpStep));
}
Also used : Connector(io.syndesis.common.model.connection.Connector) Connection(io.syndesis.common.model.connection.Connection) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) Step(io.syndesis.common.model.integration.Step) And(cucumber.api.java.en.And)

Example 5 with StepDefinition

use of io.syndesis.qe.bdd.entities.StepDefinition in project syndesis-qe by syndesisio.

the class FtpSteps method setFtpDownloadData.

@And("^creates start FTP download action with values$")
public void setFtpDownloadData(DataTable sourceMappingData) {
    final Connection ftpConnection = connectionsEndpoint.get(RestConstants.getFTP_CONNECTION_ID());
    final Connector ftpConnector = connectorsEndpoint.get("ftp");
    Map<String, String> dataMap = sourceMappingData.asMaps(String.class, String.class).get(0);
    final Step ftpStep = new Step.Builder().stepKind(StepKind.endpoint).connection(ftpConnection).id(UUID.randomUUID().toString()).action(TestUtils.findConnectorAction(ftpConnector, "io.syndesis:ftp-download-connector")).configuredProperties(dataMap).build();
    steps.getStepDefinitions().add(new StepDefinition(ftpStep));
}
Also used : Connector(io.syndesis.common.model.connection.Connector) Connection(io.syndesis.common.model.connection.Connection) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) Step(io.syndesis.common.model.integration.Step) And(cucumber.api.java.en.And)

Aggregations

StepDefinition (io.syndesis.qe.bdd.entities.StepDefinition)23 Step (io.syndesis.common.model.integration.Step)17 Connection (io.syndesis.common.model.connection.Connection)13 Connector (io.syndesis.common.model.connection.Connector)13 Action (io.syndesis.common.model.action.Action)11 ConnectorDescriptor (io.syndesis.common.model.action.ConnectorDescriptor)11 Given (cucumber.api.java.en.Given)10 AbstractStep (io.syndesis.qe.bdd.AbstractStep)9 DataMapperStepDefinition (io.syndesis.qe.bdd.entities.DataMapperStepDefinition)9 And (cucumber.api.java.en.And)4 Then (cucumber.api.java.en.Then)4 JavaField (io.atlasmap.java.v2.JavaField)3 AtlasMapping (io.atlasmap.v2.AtlasMapping)3 BaseMapping (io.atlasmap.v2.BaseMapping)3 Field (io.atlasmap.v2.Field)3 Mapping (io.atlasmap.v2.Mapping)3 Integration (io.syndesis.common.model.integration.Integration)3 StepKind (io.syndesis.common.model.integration.StepKind)3 AtlasMapperGenerator (io.syndesis.qe.bdd.datamapper.AtlasMapperGenerator)3 DataMapperDefinition (io.syndesis.qe.bdd.entities.DataMapperDefinition)3