@Test
public void shouldModifyLastAction() throws Exception {

    // Initial preparation
    final String preparationId = createPreparation("1234", "my preparation");
    final String firstStepId = applyTransformation(preparationId, "actions/append_upper_case.json");
    final String secondStepId = applyTransformation(preparationId, "actions/append_lower_case.json");
    Preparation preparation = repository.get(preparationId, Preparation.class);
    final long oldModificationDate = preparation.getLastModificationDate();
    // when : update second (last) step
    given()
            .body(IOUtils.toString(
                    PreparationControllerTest.class.getResourceAsStream("actions/append_update_upper_case.json"),
                    UTF_8))
            .contentType(ContentType.JSON)
            .when()
            .put("/preparations/{id}/actions/{action}", preparationId, secondStepId);
    // then
    preparation = repository.get(preparationId, Preparation.class);
    assertThat(preparation.getLastModificationDate(), is(greaterThan(oldModificationDate)));
    final Step head = repository.get(preparation.getHeadId(), Step.class);
    assertThat(head.getParent(), is(firstStepId));
}