use of io.atlasmap.v2.PropertyField in project atlasmap by atlasmap.
the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldDuplicateCustomOrdering.
@Test
public void testProcessPropertyFieldDuplicateCustomOrdering() throws Exception {
PropertyField propField = AtlasModelFactory.createPropertyField();
propField.setName("dupe-string");
propStrategy.setPropertyOrderValue(Arrays.asList(AtlasPropertyType.MAPPING_DEFINED_PROPERTIES.value(), AtlasPropertyType.RUNTIME_PROPERTIES.value()));
propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
assertNotNull(propField);
assertNotNull(propField.getValue());
assertTrue(propField.getValue() instanceof String);
assertEquals("whatup", propField.getValue());
}
use of io.atlasmap.v2.PropertyField in project atlasmap by atlasmap.
the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefinedNullRuntime.
@Test
public void testProcessPropertyFieldMappingDefinedNullRuntime() throws Exception {
PropertyField propField = AtlasModelFactory.createPropertyField();
propField.setName("prop-int");
propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, null);
assertNotNull(propField);
assertNotNull(propField.getValue());
assertTrue(propField.getValue() instanceof Integer);
assertEquals(new Integer(Integer.MIN_VALUE), new Integer((Integer) propField.getValue()));
}
use of io.atlasmap.v2.PropertyField in project atlasmap by atlasmap.
the class PropertyModuleTest method testProcessSourceFieldMapping.
@Test
public void testProcessSourceFieldMapping() throws AtlasException {
PropertyField field = mock(PropertyField.class);
when(field.getValue()).thenReturn("fieldValue");
Head head = mock(Head.class);
when(head.getSourceField()).thenReturn(field);
AtlasInternalSession session = mock(AtlasInternalSession.class);
when(session.head()).thenReturn(head);
DefaultAtlasConversionService atlasConversionService = mock(DefaultAtlasConversionService.class);
when(atlasConversionService.fieldTypeFromClass(any(String.class))).thenReturn(FieldType.ANY);
module.setConversionService(atlasConversionService);
module.processSourceFieldMapping(session);
}
use of io.atlasmap.v2.PropertyField in project atlasmap by atlasmap.
the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldMappingDefinedNoConversionService.
@Test
public void testProcessPropertyFieldMappingDefinedNoConversionService() throws Exception {
PropertyField propField = AtlasModelFactory.createPropertyField();
propField.setName("prop-int");
propStrategy.setAtlasConversionService(null);
propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
assertNotNull(propField);
assertNotNull(propField.getValue());
assertTrue(propField.getValue() instanceof String);
assertEquals(new Integer(Integer.MIN_VALUE).toString(), propField.getValue());
}
use of io.atlasmap.v2.PropertyField in project atlasmap by atlasmap.
the class DefaultAtlasPropertyStrategyTest method testProcessPropertyFieldNullName.
@Test
public void testProcessPropertyFieldNullName() throws Exception {
PropertyField propField = AtlasModelFactory.createPropertyField();
propStrategy.processPropertyField(AtlasTestData.generateAtlasMapping(), propField, AtlasTestData.generateRuntimeProperties());
}
Aggregations