Search in sources :

Example 1 with AnalysisMetadataHolder

use of org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolder 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);
    AnalysisMetadataHolder analysisMetadataHolder = mock(AnalysisMetadataHolder.class);
    DbClient dbClient = mock(DbClient.class);
    SourceHashRepository sourceHashRepository = mock(SourceHashRepository.class);
    ScmInfoRepositoryImpl underTest = new ScmInfoRepositoryImpl(batchReportReader, analysisMetadataHolder, dbClient, sourceHashRepository);
    assertThat(underTest.getScmInfo(component)).isAbsent();
    verifyNoMoreInteractions(batchReportReader, analysisMetadataHolder, dbClient, sourceHashRepository);
}
Also used : AnalysisMetadataHolder(org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolder) DbClient(org.sonar.db.DbClient) SourceHashRepository(org.sonar.server.computation.task.projectanalysis.source.SourceHashRepository) BatchReportReader(org.sonar.server.computation.task.projectanalysis.batch.BatchReportReader) Test(org.junit.Test) UseDataProvider(com.tngtech.java.junit.dataprovider.UseDataProvider)

Aggregations

UseDataProvider (com.tngtech.java.junit.dataprovider.UseDataProvider)1 Test (org.junit.Test)1 DbClient (org.sonar.db.DbClient)1 AnalysisMetadataHolder (org.sonar.server.computation.task.projectanalysis.analysis.AnalysisMetadataHolder)1 BatchReportReader (org.sonar.server.computation.task.projectanalysis.batch.BatchReportReader)1 SourceHashRepository (org.sonar.server.computation.task.projectanalysis.source.SourceHashRepository)1