Search in sources :

Example 1 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefinedNullMapping.

@Test
public void testProcessPropertyFieldMappingDefinedNullMapping() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("prop-int");
    AtlasMapping mapping = AtlasTestData.generateAtlasMapping();
    mapping.setProperties(null);
    propStrategy.processPropertyField(null, 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 2 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldRuntime.

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

Example 3 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefinedNullProperties.

@Test
public void testProcessPropertyFieldMappingDefinedNullProperties() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("prop-int");
    AtlasMapping mapping = AtlasTestData.generateAtlasMapping();
    mapping.setProperties(null);
    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 4 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefinedDisabled.

@Test
public void testProcessPropertyFieldMappingDefinedDisabled() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("prop-int");
    propStrategy.setMappingDefinedPropertiesEnabled(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 5 with PropertyField

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

the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldEnvironmentDisabled.

@Test
public void testProcessPropertyFieldEnvironmentDisabled() throws Exception {
    PropertyField propField = AtlasModelFactory.createPropertyField();
    propField.setName("PATH");
    propStrategy.setEnvironmentPropertiesEnabled(false);
    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