Search in sources :

Example 16 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefinedEmptyRuntime.

@Test
public void testProcessPropertyFieldMappingDefinedEmptyRuntime() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("prop-int");
    propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, new HashMap<String, Object>());
    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 17 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefinedEmptyProperties.

@Test
public void testProcessPropertyFieldMappingDefinedEmptyProperties() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("prop-int");
    AtlasMapping mapping = AtlasTestData.generateAtlasMapping();
    mapping.getProperties().getProperty().clear();
    propStrategy.processPropertyField(mapping, propField, AtlasTestData.generateRuntimeProperties());
    assertNotNull(propField);
    assertNull(propField.getValue());
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) AtlasMapping(io.atlasmap.v2.AtlasMapping) Test(org.junit.Test)

Example 18 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldRuntimeDisabled.

@Test
public void testProcessPropertyFieldRuntimeDisabled() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("key-float");
    propStrategy.setRuntimePropertiesEnabled(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 19 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldDuplicateDefaultOrdering.

@Test
public void testProcessPropertyFieldDuplicateDefaultOrdering() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("dupe-string");
    propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
    assertNotNull(propField);
    assertNotNull(propField.getValue());
    assertTrue(propField.getValue() instanceof String);
    assertEquals("uh oh", propField.getValue());
}
Also used : PropertyField(io.atlasmap.v2.PropertyField) Test(org.junit.Test)

Example 20 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldEnvironment.

@Test
public void testProcessPropertyFieldEnvironment() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("PATH");
    propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
    assertNotNull(propField);
    assertNotNull(propField.getValue());
    assertTrue(propField.getValue() instanceof String);
    assertTrue(((String) propField.getValue()).contains(File.pathSeparator));
}
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