@Test
public void testAnalysis() {

    String id = UUID.randomUUID().toString();
    final DataSetMetadata metadata = metadataBuilder.metadata().id(id).build();
    dataSetMetadataRepository.save(metadata);
    contentStore.storeAsRaw(metadata, DataSetServiceTest.class.getResourceAsStream("../avengers.csv"));
    formatAnalysis.analyze(id);
    contentAnalysis.analyze(id);
    schemaAnalysis.analyze(id);
    // Analyze quality
    qualityAnalysis.analyze(id);
    final DataSetMetadata actual = dataSetMetadataRepository.get(id);
    assertThat(actual.getLifecycle().qualityAnalyzed(), is(true));
    assertThat(actual.getContent().getNbRecords(), is(5L));
    for (ColumnMetadata column : actual.getRowMetadata().getColumns()) {
        final Quality quality = column.getQuality();
        assertThat(quality.getValid(), is(5));
        assertThat(quality.getInvalid(), is(0));
        assertThat(quality.getEmpty(), is(0));
    }
}