use of org.sonar.ce.task.projectanalysis.batch.BatchReportReader in project sonarqube by SonarSource.
the class PersistProjectLinksStepTest method no_effect_if_branch_is_not_main.
@Test
public void no_effect_if_branch_is_not_main() {
DbClient dbClient = mock(DbClient.class);
TreeRootHolder treeRootHolder = mock(TreeRootHolder.class);
BatchReportReader reportReader = mock(BatchReportReader.class);
UuidFactory uuidFactory = mock(UuidFactory.class);
mockBranch(false);
PersistProjectLinksStep underTest = new PersistProjectLinksStep(analysisMetadataHolder, dbClient, treeRootHolder, reportReader, uuidFactory);
underTest.execute(new TestComputationStepContext());
verifyZeroInteractions(uuidFactory, reportReader, treeRootHolder, dbClient);
}
use of org.sonar.ce.task.projectanalysis.batch.BatchReportReader in project sonarqube by SonarSource.
the class ScmInfoRepositoryImplTest method do_not_query_db_nor_report_if_component_type_is_not_FILE.
@Test
@UseDataProvider("allTypeComponentButFile")
public void do_not_query_db_nor_report_if_component_type_is_not_FILE(Component component) {
BatchReportReader batchReportReader = mock(BatchReportReader.class);
ScmInfoRepositoryImpl underTest = new ScmInfoRepositoryImpl(batchReportReader, analysisMetadata, dbLoader, diff, sourceHashRepository);
assertThat(underTest.getScmInfo(component)).isEmpty();
verifyZeroInteractions(batchReportReader, dbLoader);
}
Aggregations