use of org.sonar.ce.task.projectanalysis.duplication.InExtendedProjectDuplicate in project sonarqube by SonarSource.
the class LoadDuplicationsFromReportStepTest method loads_duplication_with_otherFileRef_as_InExtendedProject_duplication.
@Test
public void loads_duplication_with_otherFileRef_as_InExtendedProject_duplication() {
Branch branch = mock(Branch.class);
when(branch.getType()).thenReturn(BranchType.PULL_REQUEST);
analysisMetadataHolder.setBranch(branch);
reportReader.putDuplications(FILE_1_REF, createDuplication(singleLineTextRange(LINE), createInProjectDuplicate(FILE_2_REF, LINE + 1)));
TestComputationStepContext context = new TestComputationStepContext();
underTest.execute(context);
assertDuplications(FILE_1_REF, singleLineDetailedTextBlock(1, LINE), new InExtendedProjectDuplicate(treeRootHolder.getComponentByRef(FILE_2_REF), singleLineTextBlock(LINE + 1)));
assertNoDuplication(FILE_2_REF);
assertNbOfDuplications(context, 1);
}
Aggregations