Search in sources :

Example 6 with Step

use of io.syndesis.common.model.integration.Step in project syndesis-qe by syndesisio.

the class IntermediateSteps method createBasicFilterStep.

@Given("^create basic TW to SF filter step")
public void createBasicFilterStep() {
    final Step basicFilter = new Step.Builder().stepKind(StepKind.ruleFilter).configuredProperties(TestUtils.map("type", "rule", "predicate", FilterPredicate.AND.toString(), "rules", new FilterRulesBuilder().addPath("text").addValue("#backendTest").addOps("contains").build())).id(UUID.randomUUID().toString()).build();
    steps.getStepDefinitions().add(new StepDefinition(basicFilter));
}
Also used : FilterRulesBuilder(io.syndesis.qe.utils.FilterRulesBuilder) FilterRulesBuilder(io.syndesis.qe.utils.FilterRulesBuilder) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) Step(io.syndesis.common.model.integration.Step) Given(cucumber.api.java.en.Given)

Example 7 with Step

use of io.syndesis.common.model.integration.Step in project syndesis-qe by syndesisio.

the class IntermediateSteps method addLogStep.

@Given("add log step")
public void addLogStep() {
    final Step basicFilter = new Step.Builder().stepKind(StepKind.log).configuredProperties(TestUtils.map("contextLoggingEnabled", "true", "bodyLoggingEnabled", "true")).id(UUID.randomUUID().toString()).build();
    steps.getStepDefinitions().add(new StepDefinition(basicFilter));
}
Also used : FilterRulesBuilder(io.syndesis.qe.utils.FilterRulesBuilder) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) Step(io.syndesis.common.model.integration.Step) Given(cucumber.api.java.en.Given)

Example 8 with Step

use of io.syndesis.common.model.integration.Step in project syndesis-qe by syndesisio.

the class S3Steps method createS3CopyStep.

@Given("^create S3 copy step with bucket: \"([^\"]*)\"")
public void createS3CopyStep(String bucketName) {
    final Connector s3Connector = connectorsEndpoint.get("aws-s3");
    final Connection s3Connection = connectionsEndpoint.get(S3BucketNameBuilder.getBucketName(bucketName));
    final Action s3PollingAction = TestUtils.findConnectorAction(s3Connector, "aws-s3-copy-object-connector");
    final ConnectorDescriptor connectorDescriptor = getConnectorDescriptor(s3PollingAction, new HashMap(), S3BucketNameBuilder.getBucketName(bucketName));
    final Step s3Step = new Step.Builder().stepKind(StepKind.endpoint).connection(s3Connection).id(UUID.randomUUID().toString()).action(generateStepAction(s3PollingAction, connectorDescriptor)).build();
    steps.getStepDefinitions().add(new StepDefinition(s3Step));
}
Also used : Connector(io.syndesis.common.model.connection.Connector) ConnectorDescriptor(io.syndesis.common.model.action.ConnectorDescriptor) Action(io.syndesis.common.model.action.Action) HashMap(java.util.HashMap) 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) Given(cucumber.api.java.en.Given)

Example 9 with Step

use of io.syndesis.common.model.integration.Step in project syndesis-qe by syndesisio.

the class SalesforceSteps method createSfStepWithAction.

@Given("^create SF \"([^\"]*)\" action step on field: \"([^\"]*)\"$")
public void createSfStepWithAction(String action, String field) {
    final Connector salesforceConnector = connectorsEndpoint.get("salesforce");
    final Connection salesforceConnection = connectionsEndpoint.get(RestConstants.getInstance().getSALESFORCE_CONNECTION_ID());
    final Action sfAction = TestUtils.findConnectorAction(salesforceConnector, action);
    final Map<String, String> properties = TestUtils.map("sObjectName", field);
    final ConnectorDescriptor connectorDescriptor = getConnectorDescriptor(sfAction, properties, RestConstants.getInstance().getSALESFORCE_CONNECTION_ID());
    final Step salesforceStep = new Step.Builder().stepKind(StepKind.endpoint).id(UUID.randomUUID().toString()).connection(salesforceConnection).action(generateStepAction(sfAction, connectorDescriptor)).configuredProperties(properties).build();
    steps.getStepDefinitions().add(new StepDefinition(salesforceStep, 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) Given(cucumber.api.java.en.Given)

Example 10 with Step

use of io.syndesis.common.model.integration.Step in project syndesis-qe by syndesisio.

the class UiComplexSteps method processMapperSteps.

private void processMapperSteps() {
    List<StepDefinition> mappers = steps.getStepDefinitions().stream().filter(s -> s.getStep().getStepKind().equals(StepKind.mapper)).collect(Collectors.toList());
    if (mappers.isEmpty()) {
        log.debug("There are no mappers in this integration, proceeding...");
    } else {
        // mapping can be done on steps that preceed mapper step and the single step, which follows the mapper step.
        log.info("Found mapper step, creating new atlas mapping.");
        for (int i = 0; i < mappers.size(); i++) {
            List<StepDefinition> precedingSteps = steps.getStepDefinitions().subList(0, steps.getStepDefinitions().indexOf(mappers.get(i))).stream().filter(s -> s.getConnectorDescriptor().isPresent()).collect(Collectors.toList());
            StepDefinition followingStep = steps.getStepDefinitions().get(steps.getStepDefinitions().indexOf(mappers.get(i)) + 1);
            if (mappers.get(i).getStep().getConfiguredProperties().containsKey("atlasmapping")) {
                // TODO(tplevko): think of some way to substitute placeholders for the step ID's
                reflectStepIdsInAtlasMapping(mappers.get(i), precedingSteps, followingStep);
            } else {
                // TODO(tplevko): fix for more than one preceding step.
                mappers.get(i).setStep(atlasGenerator.getAtlasMappingStep(mappers.get(i), precedingSteps, followingStep));
            }
        }
    }
}
Also used : ConnectorDescriptor(io.syndesis.common.model.action.ConnectorDescriptor) Arrays(java.util.Arrays) Action(io.syndesis.common.model.action.Action) Step(io.syndesis.common.model.integration.Step) Autowired(org.springframework.beans.factory.annotation.Autowired) MappingType(io.atlasmap.v2.MappingType) ConnectorsEndpoint(io.syndesis.qe.endpoints.ConnectorsEndpoint) DataMapperStepDefinition(io.syndesis.qe.bdd.entities.DataMapperStepDefinition) IntegrationsDeploymentEndpoint(io.syndesis.qe.endpoints.IntegrationsDeploymentEndpoint) Connection(io.syndesis.common.model.connection.Connection) Map(java.util.Map) Given(cucumber.api.java.en.Given) Assertions(org.assertj.core.api.Assertions) StepKind(io.syndesis.common.model.integration.StepKind) Integration(io.syndesis.common.model.integration.Integration) ConnectionsEndpoint(io.syndesis.qe.endpoints.ConnectionsEndpoint) Connector(io.syndesis.common.model.connection.Connector) AtlasMapperGenerator(io.syndesis.qe.bdd.datamapper.AtlasMapperGenerator) IOException(java.io.IOException) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) IntegrationOverview(io.syndesis.qe.model.IntegrationOverview) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) IntegrationsEndpoint(io.syndesis.qe.endpoints.IntegrationsEndpoint) TestUtils(io.syndesis.qe.utils.TestUtils) DataMapperDefinition(io.syndesis.qe.bdd.entities.DataMapperDefinition) StepsStorage(io.syndesis.qe.bdd.storage.StepsStorage) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) IntegrationOverviewEndpoint(io.syndesis.qe.endpoints.IntegrationOverviewEndpoint) DataMapperStepDefinition(io.syndesis.qe.bdd.entities.DataMapperStepDefinition) StepDefinition(io.syndesis.qe.bdd.entities.StepDefinition) ConnectorsEndpoint(io.syndesis.qe.endpoints.ConnectorsEndpoint) IntegrationsDeploymentEndpoint(io.syndesis.qe.endpoints.IntegrationsDeploymentEndpoint) ConnectionsEndpoint(io.syndesis.qe.endpoints.ConnectionsEndpoint) IntegrationsEndpoint(io.syndesis.qe.endpoints.IntegrationsEndpoint) IntegrationOverviewEndpoint(io.syndesis.qe.endpoints.IntegrationOverviewEndpoint)

Aggregations

Step (io.syndesis.common.model.integration.Step)18 StepDefinition (io.syndesis.qe.bdd.entities.StepDefinition)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)5 And (cucumber.api.java.en.And)4 Then (cucumber.api.java.en.Then)3 DataMapperDefinition (io.syndesis.qe.bdd.entities.DataMapperDefinition)3 MappingType (io.atlasmap.v2.MappingType)2 Integration (io.syndesis.common.model.integration.Integration)2 StepKind (io.syndesis.common.model.integration.StepKind)2 AtlasMapperGenerator (io.syndesis.qe.bdd.datamapper.AtlasMapperGenerator)2 StepsStorage (io.syndesis.qe.bdd.storage.StepsStorage)2 ConnectionsEndpoint (io.syndesis.qe.endpoints.ConnectionsEndpoint)2 ConnectorsEndpoint (io.syndesis.qe.endpoints.ConnectorsEndpoint)2 IntegrationOverviewEndpoint (io.syndesis.qe.endpoints.IntegrationOverviewEndpoint)2