@Test
public void shouldThrowExceptionOnPreparationHeadChangeWithUnknownStep() throws Exception {

    // given
    final String preparationId = createPreparation("1234", "my preparation");
    final String firstStepId = applyTransformation(preparationId, "actions/append_upper_case.json");
    Preparation preparation = repository.get(preparationId, Preparation.class);
    assertThat(preparation.getHeadId(), is(firstStepId));
    // when
    final Response response = given()
            .when()//
            .put("/preparations/{id}/head/{stepId}", preparationId, "unknown_step_id");
    // then
    response
            .then()//
            .statusCode(404)//
            .assertThat()//
            .body("code", is("TDP_PS_PREPARATION_STEP_DOES_NOT_EXIST"));
}