use of io.atlasmap.v2.IndexOf 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));
}
}
}
}
use of io.atlasmap.v2.IndexOf in project atlasmap by atlasmap.
the class DefaultAtlasFieldActionsServiceTest method testFindActionDetail.
@Test
public void testFindActionDetail() {
ActionDetail actionDetail = fieldActionsService.findActionDetail("IndexOf", FieldType.STRING);
assertNotNull(actionDetail);
actionDetail = fieldActionsService.findActionDetail("Index", FieldType.STRING);
assertNull(actionDetail);
ActionDetail ad = new ActionDetail();
ad.setName("IndexOf");
ad.setSourceType(FieldType.INTEGER);
fieldActionsService.listActionDetails().add(ad);
actionDetail = fieldActionsService.findActionDetail("IndexOf", null);
assertNotNull(actionDetail);
actionDetail = fieldActionsService.findActionDetail("IndexOf", FieldType.STRING);
assertNotNull(actionDetail);
actionDetail = fieldActionsService.findActionDetail("IndexOf", FieldType.ANY);
assertNotNull(actionDetail);
actionDetail = fieldActionsService.findActionDetail("IndexOf", FieldType.NONE);
assertNotNull(actionDetail);
actionDetail = fieldActionsService.findActionDetail("IndexOf", FieldType.BOOLEAN);
assertNotNull(actionDetail);
}
use of io.atlasmap.v2.IndexOf in project atlasmap by atlasmap.
the class StringComplexFieldActionsTest method testIndexOf.
@Test
public void testIndexOf() {
IndexOf action = new IndexOf();
action.setString("");
assertEquals(-1, StringComplexFieldActions.indexOf(action, null));
assertEquals(0, StringComplexFieldActions.indexOf(action, ""));
assertEquals(0, StringComplexFieldActions.indexOf(action, "foo"));
action.setString("bar");
assertEquals(-1, StringComplexFieldActions.indexOf(action, null));
assertEquals(-1, StringComplexFieldActions.indexOf(action, ""));
assertEquals(-1, StringComplexFieldActions.indexOf(action, "foo"));
assertEquals(3, StringComplexFieldActions.indexOf(action, "foobar"));
assertEquals(3, StringComplexFieldActions.indexOf(action, "foobarbar"));
}
Aggregations