use of org.sonar.server.computation.task.projectanalysis.duplication.Duplicate in project sonarqube by SonarSource.
the class PersistFileSourcesStepTest method persist_duplication.
@Test
public void persist_duplication() {
initBasicReport(1);
duplicationRepository.add(FILE_REF, new Duplication(new TextBlock(1, 2), Arrays.<Duplicate>asList(new InnerDuplicate(new TextBlock(3, 4)))));
underTest.execute();
assertThat(dbTester.countRowsOfTable("file_sources")).isEqualTo(1);
FileSourceDto fileSourceDto = dbClient.fileSourceDao().selectSourceByFileUuid(session, FILE_UUID);
DbFileSources.Data data = fileSourceDto.getSourceData();
assertThat(data.getLinesList()).hasSize(1);
assertThat(data.getLines(0).getDuplicationList()).hasSize(1);
}
Aggregations