use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.
the class OverloadedFieldActionsTest method testListActions.
@Test
public void testListActions() throws Exception {
List<ActionDetail> actions = DefaultAtlasContextFactory.getInstance().getFieldActionService().listActionDetails();
Integer found = 0;
for (ActionDetail d : actions) {
if (d.getName().equals("DayOfWeek")) {
found++;
}
}
assertEquals(Integer.valueOf(2), found);
}
use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.
the class DefaultAtlasFieldActionsServiceTest method testProcessActionsActionsField.
@Test
public void testProcessActionsActionsField() throws AtlasException {
Actions actions = null;
SimpleField field = new SimpleField();
field.setFieldType(FieldType.COMPLEX);
fieldActionsService.processActions(actions, field);
field.setValue(null);
field.setFieldType(FieldType.INTEGER);
fieldActionsService.processActions(actions, field);
field.setValue(new Integer(0));
field.setFieldType(FieldType.INTEGER);
fieldActionsService.processActions(actions, field);
@SuppressWarnings("serial")
class MockActions extends Actions {
@Override
public List<Action> getActions() {
return null;
}
}
fieldActionsService.processActions(new MockActions(), field);
actions = new Actions();
fieldActionsService.processActions(actions, field);
actions.getActions().add(new Trim());
field.setValue("testString");
field.setFieldType(FieldType.STRING);
fieldActionsService.processActions(actions, field);
field.setValue(new Integer(8));
field.setFieldType(FieldType.NUMBER);
fieldActionsService.processActions(actions, field);
}
use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.
the class DefaultAtlasFieldActionsServiceTest method testProcessActionsActionsFieldAtlasConversionException.
@Test(expected = AtlasConversionException.class)
public void testProcessActionsActionsFieldAtlasConversionException() throws AtlasException {
Actions actions = null;
SimpleField field = new SimpleField();
Object value = new Object();
field.setValue(value);
field.setFieldType(FieldType.INTEGER);
fieldActionsService.processActions(actions, field);
}
use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.
the class DefaultAtlasFieldActionsServiceTest method testprocessActionsActionsObjectFieldType.
@Test
public void testprocessActionsActionsObjectFieldType() throws AtlasException {
Actions actions = new Actions();
assertNotNull(fieldActionsService.processActions(actions, "testString", FieldType.STRING));
assertNotNull(fieldActionsService.processActions(actions, new Integer(8), FieldType.STRING));
}
use of io.atlasmap.v2.Actions in project atlasmap by atlasmap.
the class DefaultAtlasFieldActionsServiceTest method testprocessActionsActionsObjectFieldTypeAtlasConversionException.
@Test(expected = AtlasConversionException.class)
public void testprocessActionsActionsObjectFieldTypeAtlasConversionException() throws AtlasException {
Actions actions = null;
SimpleField field = new SimpleField();
Object value = new Object();
field.setValue(value);
field.setFieldType(FieldType.INTEGER);
fieldActionsService.processActions(actions, field);
}
Aggregations