use of io.atlasmap.v2.Mapping in project atlasmap by atlasmap.
the class AtlasModuleSupportTest method testListTargetPathsAtlasMapping.
@Test
public void testListTargetPathsAtlasMapping() {
AtlasMapping atlasMapping = null;
assertEquals(0, AtlasModuleSupport.listTargetPaths(atlasMapping).size());
atlasMapping = new AtlasMapping();
assertEquals(0, AtlasModuleSupport.listTargetPaths(atlasMapping).size());
Mappings mappings = new Mappings();
atlasMapping.setMappings(mappings);
assertEquals(0, AtlasModuleSupport.listTargetPaths(atlasMapping).size());
Mapping mapping = new Mapping();
mappings.getMapping().add(mapping);
assertEquals(0, AtlasModuleSupport.listTargetPaths(atlasMapping).size());
class MockMapping extends Mappings {
private static final long serialVersionUID = 1L;
@Override
public List<BaseMapping> getMapping() {
return null;
}
}
Mappings mockMapping = new MockMapping();
atlasMapping.setMappings(mockMapping);
assertEquals(0, AtlasModuleSupport.listTargetPaths(atlasMapping).size());
}
use of io.atlasmap.v2.Mapping in project atlasmap by atlasmap.
the class AtlasMappingServiceTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() {
atlasMappingService = new AtlasMappingService();
atlasMapping = new AtlasMapping();
atlasMapping.setName("testname");
Mappings mappings = new Mappings();
Mapping mapping = new Mapping();
mapping.setId("1");
mapping.setAlias("alias1");
mappings.getMapping().add(mapping);
mapping = new Mapping();
mapping.setId("2");
mapping.setAlias("alias2");
mappings.getMapping().add(mapping);
atlasMapping.setMappings(mappings);
}
use of io.atlasmap.v2.Mapping in project atlasmap by atlasmap.
the class BaseDefaultAtlasContextTest method prepareTargetField.
protected Field prepareTargetField(Mapping mapping, String path, int index) {
Field field = prepareTargetField(mapping, path);
field.setIndex(index);
return field;
}
use of io.atlasmap.v2.Mapping in project atlasmap by atlasmap.
the class BaseDefaultAtlasContextTest method populateSourceField.
protected Field populateSourceField(Mapping mapping, FieldType type, Object value) {
Field field = new SimpleField();
field.setFieldType(type);
field.setPath("/testPath" + value);
mapping.getInputField().add(field);
reader.sources.put(field.getPath(), value);
return field;
}
use of io.atlasmap.v2.Mapping in project atlasmap by atlasmap.
the class JavaValidationServiceTest method createMockMapping.
protected Mapping createMockMapping() {
// Mock MappedField
MockField inputField = new MockField();
inputField.setName("input.name");
MockField outputField = new MockField();
outputField.setName("out.name");
Mapping mapping = new Mapping();
mapping.setMappingType(MappingType.MAP);
mapping.getInputField().add(inputField);
mapping.getOutputField().add(inputField);
return mapping;
}
Aggregations