@Test
public void testMoveStep() throws Exception {

    final String datasetId = testClient.createDataset("preview/preview_dataset.csv", "testPreview");
    String testPrepId = testClient.createPreparationFromDataset(datasetId, "testPrep", home.getId());
    AppendStep appendStep = new AppendStep();
    final Action actionToBeMoved = buildAction("uppercase",
            buildParametersMap("column_id", "0001", "column_name", "firstname", "scope", "column"));
    appendStep.setActions(Arrays.asList(
            buildAction("uppercase",
                    buildParametersMap("column_id", "0002", "column_name", "lastname", "scope", "column")),
            actionToBeMoved));
    appendStepsToPrep(testPrepId, appendStep);
    // Adding steps
    PreparationDTO testPrepDetails = getPreparationDetails(testPrepId);
    List<String> stepsCreated = testPrepDetails.getSteps();
    String rootStep = stepsCreated.get(0);
    String secondStep = stepsCreated.get(2);
    // changing steps order
    changePreparationStepsOrder(testPrepId, rootStep, secondStep);
    PreparationDTO testPrepDetailsAfter = getPreparationDetails(testPrepId);
    final Action initialUpperCaseAction = getActions(testPrepDetails.getSteps().get(2)).get(1);
    assertEquals(actionToBeMoved, initialUpperCaseAction);
    final Action movedAction = getActions(testPrepDetailsAfter.getSteps().get(1)).get(0);
    assertEquals(initialUpperCaseAction, movedAction);
}