@Test
public void shouldAddActionWithFilterStepAfterHead() throws Exception {

    // given
    final String preparationId = createPreparation("1234", "my preparation");
    Preparation preparation = repository.get(preparationId, Preparation.class);
    final long oldModificationDate = preparation.getLastModificationDate();
    assertThat(preparation.getHeadId(), is(Step.ROOT_STEP.getId()));
    // when
    applyTransformation(preparationId, "actions/append_copy_lastname_filter.json");
    // then
    preparation = repository.get(preparation.id(), Preparation.class);
    assertThat(preparation.getLastModificationDate(), is(greaterThan(oldModificationDate)));
    final Step head = repository.get(preparation.getHeadId(), Step.class);
    final PreparationActions headAction = repository.get(head.getContent(), PreparationActions.class);
    assertThat(headAction.getActions(), hasSize(1));
    final Action copyAction = headAction.getActions().get(0);
    assertThat(copyAction.getName(), is("copy"));
    assertThat(copyAction.getParameters().get(ImplicitParameters.FILTER.getKey()),
            is("{\"eq\":{\"field\":\"0001\",\"value\":\"value\"}}"));
}