@Test
public void shouldListPreparationsInFolder() throws Exception {

    // given
    folderRepository.addFolder(home.getId(), "/one");
    folderRepository.addFolder(home.getId(), "/two");
    testClient.createPreparationFromFile("dataset/dataset.csv", "yet another preparation", home.getId());
    testClient.createPreparationFromFile("dataset/dataset.csv", "prep 2", home.getId());
    testClient.createPreparationFromFile("dataset/dataset.csv", "preparation 3 !", home.getId());
    // when
    final Response response = given() //
            .when()//
            .expect()
            .statusCode(200)
            .log()
            .ifError() //
            .get("/api/folders/{id}/preparations", home.getId());
    // then
    assertThat(response.getStatusCode(), is(200));
    final JsonNode rootNode = mapper.readTree(response.asInputStream());
    final JsonNode folders = rootNode.get("folders");
    assertNotNull(folders);
    assertEquals(2, folders.size());
    final JsonNode preparations = rootNode.get("preparations");
    assertNotNull(preparations);
    assertEquals(3, preparations.size());
    for (JsonNode preparation : preparations) {
        final JsonNode dataset = preparation.get("dataset");
        // check for dataset
        assertNotNull(dataset);
        assertTrue(dataset.has("dataSetName"));
    }
}