use of org.sonar.db.DbClient 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);
}
use of org.sonar.db.DbClient in project sonarqube by SonarSource.
the class CustomMeasuresCopyStepTest method setUp.
@Before
public void setUp() {
DbClient dbClient = dbTester.getDbClient();
underTest = new CustomMeasuresCopyStep(treeRootHolder, dbClient, metricRepository, measureRepository);
}
use of org.sonar.db.DbClient in project sonarqube by SonarSource.
the class DefaultMetricFinderTest method setUp.
@Before
public void setUp() {
dbTester.prepareDbUnit(DefaultMetricFinderTest.class, "shared.xml");
finder = new DefaultMetricFinder(new DbClient(dbTester.database(), dbTester.myBatis(), new MetricDao()));
}
use of org.sonar.db.DbClient in project sonarqube by SonarSource.
the class DomainsActionTest method setUp.
@Before
public void setUp() {
dbClient = new DbClient(db.database(), db.myBatis(), new MetricDao());
dbSession = dbClient.openSession(false);
ws = new WsTester(new MetricsWs(new DomainsAction(dbClient)));
}
use of org.sonar.db.DbClient in project sonarqube by SonarSource.
the class MetricsWsTest method setUp.
@Before
public void setUp() {
DbClient dbClient = mock(DbClient.class);
UserSession userSession = mock(UserSession.class);
ws = new WsTester(new MetricsWs(new SearchAction(dbClient), new CreateAction(dbClient, userSession), new UpdateAction(dbClient, userSession), new DeleteAction(dbClient, userSession), new TypesAction(), new DomainsAction(dbClient)));
}
Aggregations