use of org.talend.dataprep.helper.api.Action in project data-prep by Talend.
the class OSIntegrationTestUtilTest method mapParamsToActionEmpty.
@Test
public void mapParamsToActionEmpty() {
Action action = new Action();
action.parameters = util.mapParamsToActionParameters(new HashMap<>());
assertEquals(null, action.id);
assertEquals(null, action.action);
assertEquals("column", action.parameters.get("scope"));
}
use of org.talend.dataprep.helper.api.Action in project data-prep by Talend.
the class ActionStep method whenIAddAStepToAPreparation.
@When("^I add a \"(.*)\" step on the preparation \"(.*)\" with parameters :$")
public void whenIAddAStepToAPreparation(String actionName, String preparationName, DataTable dataTable) {
Map<String, String> params = dataTable.asMap(String.class, String.class);
String prepId = context.getPreparationId(suffixName(preparationName));
Action action = new Action();
action.action = actionName;
action.parameters.putAll(util.mapParamsToActionParameters(params));
api.addAction(prepId, action);
}
use of org.talend.dataprep.helper.api.Action in project data-prep by Talend.
the class ActionStep method removeFirstActionFoundWithName.
@Given("I remove the first action with name \"(.*)\" on the preparation \"(.*)\"")
public void removeFirstActionFoundWithName(String actionName, String prepName) throws IOException {
String prepId = context.getPreparationId(suffixName(prepName));
Action foundAction = getFirstActionWithName(prepId, actionName);
Assert.assertTrue(foundAction != null);
// Remove action
Response response = api.deleteAction(prepId, foundAction.id);
response.then().statusCode(200);
}
use of org.talend.dataprep.helper.api.Action in project data-prep by Talend.
the class ActionStep method getActionsFromStoredAction.
/**
* Recover a list of {@link Action} corresponding to a stored {@link Action} type in a given preparation.
*
* @param preparationId the preparation id.
* @param storedAction the stored {@link Action} type.
* @return a {@link List} of {@link Action} that looks like the given storedAction.
* @throws IOException
*/
private List<Action> getActionsFromStoredAction(String preparationId, Action storedAction) throws IOException {
PreparationDetails prepDet = getPreparationDetails(preparationId);
prepDet.updateActionIds();
return prepDet.actions.stream().filter(action -> //
action.action.equals(storedAction.action) && //
action.parameters.equals(storedAction.parameters)).collect(Collectors.toList());
}
Aggregations