use of org.talend.dataprep.transformation.actions.text.LowerCase in project data-prep by Talend.
the class InjectorUtilTest method testInjectPreparationDetailsDTO.
@Test
public void testInjectPreparationDetailsDTO() throws IllegalAccessException, InstantiationException {
PreparationDetailsDTO prep = new PreparationDetailsDTO();
List<Action> actions = new ArrayList<>();
actions.add(getSimpleAction("uppercase", "column_name", "lastname"));
actions.add(getSimpleAction("lowercase", "column_name", "lastname"));
when(actionRegistry.get("uppercase")).thenReturn(UpperCase.class.newInstance());
when(actionRegistry.get("lowercase")).thenReturn(LowerCase.class.newInstance());
PreparationDetailsDTO detailsPrep = injectorUtil.injectPreparationDetails(actions, prep);
detailsPrep.getMetadata().forEach(af -> {
af.getParameters().forEach(p -> {
// we check if action create new column then it is on readonly mode
if (p.getName().equals(CREATE_NEW_COLUMN)) {
assertTrue(p.isReadonly());
}
});
});
assertEquals("Number of action should be the same", actions.size(), detailsPrep.getActions().size());
assertEquals("Number of ActionForm should be the same", actions.size(), detailsPrep.getMetadata().size());
}
Aggregations