use of io.atlasmap.v2.AtlasMapping in project atlasmap by atlasmap.
the class BaseMarshallerTest method generateMapping.
private void generateMapping(AtlasMapping atlasMapping) {
Mapping mapping = AtlasModelFactory.createMapping(MappingType.MAP);
generateInputField(mapping);
generateOutputField(mapping);
mapping.setMappingType(MappingType.MAP);
mapping.setDelimiterString(",");
mapping.setAlias("MapPropertyFieldAlias");
mapping.setDelimiter(",");
mapping.setDescription("description");
mapping.setId("id");
mapping.setLookupTableName("lookupTableName");
mapping.setStrategy("strategy");
mapping.setStrategyClassName("strategyClassName");
atlasMapping.getMappings().getMapping().add(mapping);
}
use of io.atlasmap.v2.AtlasMapping 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.AtlasMapping in project atlasmap by atlasmap.
the class XmlMarshallerTest method testReferenceMapping.
@Test
public void testReferenceMapping() throws Exception {
marshaller.marshal(generateAtlasMapping(), new File("target/junit/" + testName.getMethodName() + "/" + "atlasmapping.xml"));
StreamSource fileSource = new StreamSource(new File("target/junit/" + testName.getMethodName() + "/" + "atlasmapping.xml"));
JAXBElement<AtlasMapping> mappingElem = unmarshaller.unmarshal(fileSource, AtlasMapping.class);
assertNotNull(mappingElem);
assertNotNull(mappingElem.getValue());
validateAtlasMapping(mappingElem.getValue());
}
use of io.atlasmap.v2.AtlasMapping in project atlasmap by atlasmap.
the class AtlasMappingServiceTest method testLoadMappingReaderAtlasMappingFormat.
@Test
public void testLoadMappingReaderAtlasMappingFormat() throws Exception {
BufferedReader reader = new BufferedReader(new FileReader("src" + File.separator + "test" + File.separator + "resources" + File.separator + "atlasmapping.json"));
AtlasMapping atlasMapping = atlasMappingService.loadMapping(reader, AtlasMappingFormat.JSON);
assertNotNull(atlasMapping);
}
use of io.atlasmap.v2.AtlasMapping in project atlasmap by atlasmap.
the class AtlasMappingServiceTest method testLoadMappingFileAtlasMappingFormat.
@Test
public void testLoadMappingFileAtlasMappingFormat() throws AtlasValidationException {
File file = Paths.get("src" + File.separator + "test" + File.separator + "resources" + File.separator + "atlasmapping.json").toFile();
AtlasMapping atlasMapping = atlasMappingService.loadMapping(file, AtlasMappingFormat.JSON);
assertNotNull(atlasMapping);
}
Aggregations