@Test
public void testAnalysisWithInvalidValues() {

    String dsId = UUID.randomUUID().toString();
    final DataSetMetadata metadata = metadataBuilder.metadata().id(dsId).build();
    dataSetMetadataRepository.save(metadata);
    contentStore.storeAsRaw(metadata,
            DataSetServiceTest.class.getResourceAsStream("../dataset_with_invalid_records.csv"));
    formatAnalysis.analyze(dsId);
    contentAnalysis.analyze(dsId);
    schemaAnalysis.analyze(dsId);
    // Analyze quality
    qualityAnalysis.analyze(dsId);
    final DataSetMetadata actual = dataSetMetadataRepository.get(dsId);
    assertThat(actual.getLifecycle().qualityAnalyzed(), is(true));
    assertThat(actual.getContent().getNbRecords(), is(9L));
    assertThat(actual.getRowMetadata().getColumns().size(), is(2));
    ColumnMetadata secondColumn = actual.getRowMetadata().getColumns().get(1);
    Quality quality = secondColumn.getQuality();
    assertThat(quality.getValid(), is(6));
    assertThat(quality.getInvalid(), is(2));
    assertThat(quality.getEmpty(), is(1));
}