@Test
public void delete() throws Exception {

    String expectedId = UUID.randomUUID().toString();
    DataSetMetadata dataSetMetadata =
            metadataBuilder.metadata().id(expectedId).formatFamilyId(new CSVFormatFamily().getBeanId()).build();
    dataSetMetadata.getContent().addParameter(CSVFormatFamily.SEPARATOR_PARAMETER, ";");
    dataSetMetadataRepository.save(dataSetMetadata);
    List<String> ids = from(when().get("/datasets").asString()).get("");
    assertThat(ids.size(), is(1));
    int before = dataSetMetadataRepository.size();
    when().delete("/datasets/{id}", expectedId).then().statusCode(OK.value());
    int after = dataSetMetadataRepository.size();
    logger.debug("delete before {} after {}", before, after);
    assertThat(before - after, is(1));
}