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