@Test
public void shouldListAllPreparations() throws Exception {

    // given
    when().get("/preparations/details").then().statusCode(HttpStatus.OK.value()).body(sameJSONAs("[]"));
    final Preparation preparation =
            new Preparation("#548425458", "1234", Step.ROOT_STEP.id(), versionService.version().getVersionId());
    preparation.setCreationDate(0);
    preparation.setLastModificationDate(12345);
    repository.add(preparation);
    // when
    final Response response = when().get("/preparations/details");
    // then
    response.then().statusCode(HttpStatus.OK.value()).body(
            sameJSONAs("[{\"id\":\"#548425458\"," + "\"dataSetId\":\"1234\"," + "\"creationDate\":0,"
                    + "\"lastModificationDate\":12345}]").allowingExtraUnexpectedFields());
    // given
    final Preparation preparation1 =
            new Preparation("#1438725", "5678", Step.ROOT_STEP.id(), versionService.version().getVersionId());
    preparation1.setCreationDate(500);
    preparation1.setLastModificationDate(456789);
    repository.add(preparation1);
    // when
    final Response responseMultiple = when().get("/preparations/details");
    // then
    //@formatter:off
    responseMultiple.then()
            .statusCode(HttpStatus.OK.value())
            .body(sameJSONAs(
                    "[" +
                            "{\"id\":\"#548425458\"," +
                            "\"dataSetId\":\"1234\"," +
                            "\"creationDate\":0," +
                            "\"lastModificationDate\":12345" +
                            "}," +
                            "{\"id\":\"#1438725\"," +
                            "\"dataSetId\":\"5678\"," +
                            "\"creationDate\":500," +
                            "\"lastModificationDate\":456789" +
                            "}" +
                            "]")
                    .allowingExtraUnexpectedFields()
                    .allowingAnyArrayOrdering());
    //@formatter:on
}