@Test
public void testPreparationContentWithActions() throws Exception {

    // given
    final String preparationId =
            testClient.createPreparationFromFile("dataset/dataset.csv", "testPreparationContentGet", home.getId());
    PreparationDTO preparation = getPreparationDetails(preparationId);
    List<String> steps = preparation.getSteps();
    assertThat(steps.size(), is(1));
    assertThat(steps.get(0), is(Step.ROOT_STEP.id()));
    // when
    testClient.applyActionFromFile(preparationId, "transformation/upper_case_firstname.json");
    // then
    final PreparationDTO preparationMessage = getPreparationDetails(preparationId);
    steps = preparationMessage.getSteps();
    assertThat(steps.size(), is(2));
    assertThat(steps.get(0), is(Step.ROOT_STEP.id()));
    // Request preparation content at different versions (preparation has 2 steps -> Root + Upper Case).
    assertThat(testClient.getPreparation(preparationId).asString(), sameJSONAsFile(PreparationAPITest.class
            .getResourceAsStream("dataset/expected_dataset_firstname_uppercase_with_column.json")));
    assertThat(testClient.getPreparation(preparationId, "head").asString(), sameJSONAsFile(PreparationAPITest.class
            .getResourceAsStream("dataset/expected_dataset_firstname_uppercase_with_column.json")));
    assertThat(testClient.getPreparation(preparationId, steps.get(0)).asString(), sameJSONAsFile(
            PreparationAPITest.class.getResourceAsStream("dataset/expected_dataset_with_columns.json")));
    assertThat(testClient.getPreparation(preparationId, steps.get(1)).asString(),
            sameJSONAsFile(PreparationAPITest.class
                    .getResourceAsStream("dataset/expected_dataset_firstname_uppercase_with_column.json")));
    assertThat(testClient.getPreparation(preparationId, "origin").asString(), sameJSONAsFile(
            PreparationAPITest.class.getResourceAsStream("dataset/expected_dataset_with_columns.json")));
    assertThat(testClient.getPreparation(preparationId, Step.ROOT_STEP.id()).asString(), sameJSONAsFile(
            PreparationAPITest.class.getResourceAsStream("dataset/expected_dataset_with_columns.json")));
}