Search in sources :

Example 6 with MockField

use of io.atlasmap.v2.MockField 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;
}
Also used : MockField(io.atlasmap.v2.MockField) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 7 with MockField

use of io.atlasmap.v2.MockField in project atlasmap by atlasmap.

the class BaseMappingTest method getAtlasMappingFullValid.

protected AtlasMapping getAtlasMappingFullValid() {
    AtlasMapping mapping = AtlasModelFactory.createAtlasMapping();
    mapping.setName("thisis_a_valid.name");
    DataSource src = new DataSource();
    src.setDataSourceType(DataSourceType.SOURCE);
    src.setUri("atlas:java?2");
    DataSource tgt = new DataSource();
    tgt.setDataSourceType(DataSourceType.TARGET);
    tgt.setUri("atlas:java?3");
    mapping.getDataSource().add(src);
    mapping.getDataSource().add(tgt);
    Mapping mapFieldMapping = AtlasModelFactory.createMapping(MappingType.MAP);
    MockField inputField = AtlasModelFactory.createMockField();
    inputField.setFieldType(FieldType.STRING);
    inputField.setCustom("java.lang.String");
    inputField.setName("inputName");
    mapFieldMapping.getInputField().add(inputField);
    MockField outputField = AtlasModelFactory.createMockField();
    outputField.setFieldType(FieldType.STRING);
    outputField.setCustom("java.lang.String");
    outputField.setName("outputName");
    mapFieldMapping.getOutputField().add(outputField);
    Mapping separateMapping = AtlasModelFactory.createMapping(MappingType.SEPARATE);
    MockField sIJavaField = AtlasModelFactory.createMockField();
    sIJavaField.setFieldType(FieldType.STRING);
    sIJavaField.setCustom("java.lang.String");
    sIJavaField.setName("inputName");
    separateMapping.getInputField().add(sIJavaField);
    MockField sOJavaField = AtlasModelFactory.createMockField();
    sOJavaField.setFieldType(FieldType.STRING);
    sOJavaField.setCustom("java.lang.String");
    sOJavaField.setName("outputName");
    sOJavaField.setIndex(0);
    separateMapping.getOutputField().add(sOJavaField);
    mapping.getMappings().getMapping().add(mapFieldMapping);
    mapping.getMappings().getMapping().add(separateMapping);
    return mapping;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) MockField(io.atlasmap.v2.MockField) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping) DataSource(io.atlasmap.v2.DataSource)

Example 8 with MockField

use of io.atlasmap.v2.MockField in project atlasmap by atlasmap.

the class BaseValidatorTest method createInputJavaField.

protected Field createInputJavaField(String inputName) {
    MockField inputJavaField = AtlasModelFactory.createMockField();
    inputJavaField.setFieldType(FieldType.STRING);
    inputJavaField.setCustom("java.lang.String");
    inputJavaField.setName(inputName);
    return inputJavaField;
}
Also used : MockField(io.atlasmap.v2.MockField)

Example 9 with MockField

use of io.atlasmap.v2.MockField in project atlasmap by atlasmap.

the class BaseValidatorTest method createMockMappedFields.

protected void createMockMappedFields(AtlasMapping mapping, Mapping mapFieldMapping) {
    // Mock MappedField
    MockField inputField = new MockField();
    inputField.setName("input.name");
    MockField outputField = new MockField();
    outputField.setName("out.name");
    mapFieldMapping.getInputField().add(inputField);
    mapFieldMapping.getOutputField().add(outputField);
    mapping.getMappings().getMapping().add(mapFieldMapping);
}
Also used : MockField(io.atlasmap.v2.MockField)

Example 10 with MockField

use of io.atlasmap.v2.MockField in project atlasmap by atlasmap.

the class XmlValidationServiceTest 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;
}
Also used : MockField(io.atlasmap.v2.MockField) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Aggregations

MockField (io.atlasmap.v2.MockField)10 AtlasMapping (io.atlasmap.v2.AtlasMapping)6 Mapping (io.atlasmap.v2.Mapping)6 DataSource (io.atlasmap.v2.DataSource)2 BaseMapping (io.atlasmap.v2.BaseMapping)1 Collection (io.atlasmap.v2.Collection)1 Field (io.atlasmap.v2.Field)1 Mappings (io.atlasmap.v2.Mappings)1 Test (org.junit.Test)1