aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorEric Hartmann <hartmann.eric@gmail.com>2017-12-29 11:40:09 +0100
committerEric Hartmann <hartmann.eric@gmail.com>2017-12-29 11:40:09 +0100
commit05b31a29f72998d141956bbf58c72932daf28f47 (patch)
tree3c957624ae437c99cb05dabb10b9d151ac38cae6 /server
parentef63a6289f92d08200d5b5cee9203279c5ed2d5a (diff)
parent652bcc1cd8f6cb2d6281694a74300ef3b24fbc11 (diff)
downloadsonarqube-05b31a29f72998d141956bbf58c72932daf28f47.tar.gz
sonarqube-05b31a29f72998d141956bbf58c72932daf28f47.zip
Automatic merge from branch-6.7
* origin/branch-6.7: SONAR-10217 Fix 500 error when branch is incorrect Deactivate instable test in NewIssuesMeasureTest Upgrade to version 6.7.2-SNAPSHOT
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java13
2 files changed, 14 insertions, 1 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java
index fb225976eb5..7dca443b8e3 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueQueryFactory.java
@@ -393,6 +393,6 @@ public class IssueQueryFactory {
private static void setBranch(IssueQuery.Builder builder, ComponentDto component, @Nullable String branch) {
builder.branchUuid(branch == null ? null : component.projectUuid());
- builder.mainBranch(branch == null || !branch.equals(component.getBranch()));
+ builder.mainBranch(branch == null || component.equals(UNKNOWN_COMPONENT) || !branch.equals(component.getBranch()));
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
index c8e3753999c..591b68c2886 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/ws/SearchActionTest.java
@@ -151,6 +151,19 @@ public class SearchActionTest {
"Portfolios are not supported. If this parameter is set, 'projects' must not be set.");
}
+ //SONAR-10217
+ @Test
+ public void empty_search_with_unknown_branch() throws Exception {
+ TestResponse result = ws.newRequest()
+ .setParam("onComponentOnly", "true")
+ .setParam("componentKeys", "foo")
+ .setParam("branch", "bar")
+ .execute();
+
+ assertThat(result).isNotNull();
+ result.assertJson(this.getClass(), "empty_result.json");
+ }
+
@Test
public void empty_search() throws Exception {
TestResponse result = ws.newRequest()