aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-db-dao
diff options
context:
space:
mode:
authorssjenka <ssjenka@ops-slave-fedora25-1.internal.sonarsource.com>2017-07-21 11:31:42 +0200
committerssjenka <ssjenka@ops-slave-fedora25-1.internal.sonarsource.com>2017-07-21 11:31:42 +0200
commit6361f28a505edbd9a2b4dd5d405334bc9fd1b07b (patch)
tree6be516de097ce91ae30b2189a4df2734092a3952 /server/sonar-db-dao
parentec9ac9441625bdc759626d305cd1e858666fb646 (diff)
parentc043d942075a8abe288d20974406afd265f4249d (diff)
downloadsonarqube-6361f28a505edbd9a2b4dd5d405334bc9fd1b07b.tar.gz
sonarqube-6361f28a505edbd9a2b4dd5d405334bc9fd1b07b.zip
Automatic merge from branch-6.5
* origin/branch-6.5: SONAR-8918 Fix api/qualityprofile/search when no language available
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r--server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java4
-rw-r--r--server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java5
2 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java
index ee81f42b8d1..094483b18bb 100644
--- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java
+++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java
@@ -127,7 +127,7 @@ public class QualityProfileDao implements Dao {
}
public List<QProfileDto> selectDefaultProfiles(DbSession dbSession, OrganizationDto organization, Collection<String> languages) {
- return mapper(dbSession).selectDefaultProfiles(organization.getUuid(), languages);
+ return executeLargeInputs(languages, partition -> mapper(dbSession).selectDefaultProfiles(organization.getUuid(), partition));
}
@CheckForNull
@@ -141,7 +141,7 @@ public class QualityProfileDao implements Dao {
}
public List<QProfileDto> selectAssociatedToProjectUuidAndLanguages(DbSession dbSession, ComponentDto project, Collection<String> languages) {
- return mapper(dbSession).selectAssociatedToProjectUuidAndLanguages(project.getOrganizationUuid(), project.uuid(), languages);
+ return executeLargeInputs(languages, partition -> mapper(dbSession).selectAssociatedToProjectUuidAndLanguages(project.getOrganizationUuid(), project.uuid(), partition));
}
public List<QProfileDto> selectByLanguage(DbSession dbSession, OrganizationDto organization, String language) {
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java
index 3d8255b6005..8c2bab469c1 100644
--- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java
+++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java
@@ -312,7 +312,7 @@ public class QualityProfileDaoTest {
@Test
public void selectDefaultProfiles() {
- List<QProfileDto> sharedData = createSharedData();
+ createSharedData();
List<QProfileDto> java = underTest.selectDefaultProfiles(dbSession, organization, singletonList("java"));
assertThat(java).extracting(QProfileDto::getKee).containsOnly("java_sonar_way");
@@ -320,6 +320,7 @@ public class QualityProfileDaoTest {
assertThat(underTest.selectDefaultProfiles(dbSession, organization, singletonList("js"))).isEmpty();
assertThat(underTest.selectDefaultProfiles(dbSession, organization, of("java", "js"))).extracting(QProfileDto::getKee).containsOnly("java_sonar_way");
assertThat(underTest.selectDefaultProfiles(dbSession, organization, of("js", "java"))).extracting(QProfileDto::getKee).containsOnly("java_sonar_way");
+ assertThat(underTest.selectDefaultProfiles(dbSession, organization, Collections.emptyList())).isEmpty();
}
@Test
@@ -540,6 +541,8 @@ public class QualityProfileDaoTest {
.extracting(QProfileDto::getKee).containsExactlyInAnyOrder(javaProfile.getKee(), jsProfile.getKee());
assertThat(underTest.selectAssociatedToProjectUuidAndLanguages(dbSession, project2, singletonList("java")))
.isEmpty();
+ assertThat(underTest.selectAssociatedToProjectUuidAndLanguages(dbSession, project2, Collections.emptyList()))
+ .isEmpty();
}
@Test