Search in sources :

Example 11 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldJavaSystemDisabled.

@Test
public void testProcessPropertyFieldJavaSystemDisabled() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("java.specification.version");
    propStrategy.setSystemPropertiesEnabled(false);
    propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
    assertNotNull(propField);
    assertNull(propField.getValue());
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) Test(org.junit.Test)

Example 12 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldEmptyName.

@Test
public void testProcessPropertyFieldEmptyName() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("");
    propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) Test(org.junit.Test)

Example 13 with PropertyField

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

the class BaseMarshallerTest method generatePropertyReferenceMapping.

protected AtlasMapping generatePropertyReferenceMapping() {
    AtlasMapping mapping = generateAtlasMapping();
    PropertyField inputField = new PropertyField();
    inputField.setName("foo");
    Actions actions = new Actions();
    actions.getActions().add(new Trim());
    populateFieldComplexObject(inputField, actions, CollectionType.ARRAY, FieldStatus.SUPPORTED, FieldType.INTEGER);
    populateFieldSimpleObject(inputField, 3, "docid", "/path", false, "bar");
    Mapping fm = (Mapping) mapping.getMappings().getMapping().get(0);
    fm.getInputField().add(inputField);
    fm.getOutputField().add(inputField);
    populateMapping(fm, MappingType.MAP, "MapPropertyFieldAlias", ",", ",");
    populateMappingString(fm, "description", "id", "lookupTableName", "strategy", "strategyClassName");
    generateProperties(mapping);
    return mapping;
}
Also used : AtlasMapping(io.atlasmap.v2.AtlasMapping) PropertyField(io.atlasmap.v2.PropertyField) Actions(io.atlasmap.v2.Actions) Trim(io.atlasmap.v2.Trim) Mapping(io.atlasmap.v2.Mapping) AtlasMapping(io.atlasmap.v2.AtlasMapping)

Example 14 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefined.

@Test
public void testProcessPropertyFieldMappingDefined() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("prop-int");
    propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
    assertNotNull(propField);
    assertNotNull(propField.getValue());
    assertTrue(propField.getValue() instanceof Integer);
    assertEquals(new Integer(Integer.MIN_VALUE), new Integer((Integer) propField.getValue()));
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) Test(org.junit.Test)

Example 15 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldNotFound.

@Test
public void testProcessPropertyFieldNotFound() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("XXXXXXXXXXXXXXXXXXXXX");
    propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
    assertNotNull(propField);
    assertNull(propField.getValue());
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) Test(org.junit.Test)

Aggregations

PropertyField (io.atlasmap.v2.PropertyField)22 Test (org.junit.Test)20 AtlasMapping (io.atlasmap.v2.AtlasMapping)5 Mapping (io.atlasmap.v2.Mapping)2 AtlasInternalSession (io.atlasmap.spi.AtlasInternalSession)1 Head (io.atlasmap.spi.AtlasInternalSession.Head)1 Actions (io.atlasmap.v2.Actions)1 Properties (io.atlasmap.v2.Properties)1 Property (io.atlasmap.v2.Property)1 Trim (io.atlasmap.v2.Trim)1