use of io.atlasmap.v2.LookupTable in project atlasmap by atlasmap.
the class BaseMarshallerTest method generateLookupTables.
private void generateLookupTables(AtlasMapping atlasMapping) {
LookupTable table = new LookupTable();
table.setName("lookupTable");
table.setDescription("lookupTableDescription");
LookupEntry l1 = new LookupEntry();
l1.setSourceType(FieldType.STRING);
l1.setSourceValue("Foo");
l1.setTargetType(FieldType.STRING);
l1.setTargetValue("Bar");
table.getLookupEntry().add(l1);
atlasMapping.getLookupTables().getLookupTable().add(table);
}
use of io.atlasmap.v2.LookupTable in project atlasmap by atlasmap.
the class BaseMarshallerTest method generateLookupTables.
private void generateLookupTables(AtlasMapping atlasMapping) {
LookupTable table = new LookupTable();
table.setName("lookupTable");
table.setDescription("lookupTableDescription");
LookupEntry l1 = new LookupEntry();
l1.setSourceType(FieldType.STRING);
l1.setSourceValue("Foo");
l1.setTargetType(FieldType.STRING);
l1.setTargetValue("Bar");
table.getLookupEntry().add(l1);
atlasMapping.getLookupTables().getLookupTable().add(table);
}
use of io.atlasmap.v2.LookupTable in project atlasmap by atlasmap.
the class BaseMappingTest method getAtlasMappingWithLookupTables.
protected AtlasMapping getAtlasMappingWithLookupTables(String... names) {
AtlasMapping mapping = this.getAtlasMappingFullValid();
LookupTables lookupTables = new LookupTables();
mapping.setLookupTables(lookupTables);
for (String name : names) {
LookupTable lookupTable = new LookupTable();
lookupTable.setName(name);
lookupTable.setDescription("desc_".concat(name));
lookupTables.getLookupTable().add(lookupTable);
Mapping lookupFieldMapping = AtlasModelFactory.createMapping(MappingType.LOOKUP);
lookupFieldMapping.setDescription("field_desc_".concat(name));
lookupFieldMapping.setLookupTableName(name);
Field inputField = createInputJavaField("inputName");
Field outputField = createInputJavaField("outputName");
lookupFieldMapping.getInputField().add(inputField);
lookupFieldMapping.getOutputField().add(outputField);
mapping.getMappings().getMapping().add(lookupFieldMapping);
}
return mapping;
}
use of io.atlasmap.v2.LookupTable in project atlasmap by atlasmap.
the class LookupTableNameValidatorTest method makeLookupTables.
private LookupTables makeLookupTables() {
LookupTables lookupTables = new LookupTables();
LookupTable lookupTable = new LookupTable();
LookupTable lookupTable2 = new LookupTable();
LookupTable lookupTableDup = new LookupTable();
lookupTable.setName("qwerty");
lookupTable2.setName("anotherName");
lookupTableDup.setName("qwerty");
lookupTables.getLookupTable().add(lookupTable);
lookupTables.getLookupTable().add(lookupTable2);
lookupTables.getLookupTable().add(lookupTableDup);
return lookupTables;
}
use of io.atlasmap.v2.LookupTable in project atlasmap by atlasmap.
the class DefaultAtlasValidationServiceTest method testValidateAtlasMappingFileLookupFieldMappingUnusedLookupTable.
@Test
public void testValidateAtlasMappingFileLookupFieldMappingUnusedLookupTable() {
AtlasMapping mapping = getAtlasMappingFullValid();
LookupTables lookupTables = new LookupTables();
mapping.setLookupTables(lookupTables);
LookupTable lookupTable = new LookupTable();
lookupTable.setName("table1");
lookupTable.setDescription("desc_table1");
LookupTable lookupTable2 = new LookupTable();
lookupTable2.setName("table2");
lookupTable2.setDescription("desc_table2");
lookupTables.getLookupTable().add(lookupTable);
lookupTables.getLookupTable().add(lookupTable2);
Mapping lookupFieldMapping = AtlasModelFactory.createMapping(MappingType.LOOKUP);
lookupFieldMapping.setLookupTableName("table1");
Field inputField = createInputJavaField("inputName");
Field outputField = createInputJavaField("outputName");
lookupFieldMapping.getInputField().add(inputField);
lookupFieldMapping.getOutputField().add(outputField);
mapping.getMappings().getMapping().add(lookupFieldMapping);
validations.addAll(validationService.validateMapping(mapping));
assertFalse(validationHelper.hasErrors());
assertTrue(validationHelper.hasWarnings());
assertFalse(validationHelper.hasInfos());
}
Aggregations