ComponentDto component = data.getComponentByUuid(dto.getComponentUuid());
issueBuilder.setOrganization(data.getOrganizationKey(component.getOrganizationUuid()));
- issueBuilder.setComponent(component.getDbKey());
+ issueBuilder.setComponent(component.getKey());
+ setNullable(component.getBranch(), issueBuilder::setBranch);
ComponentDto project = data.getComponentByUuid(dto.getProjectUuid());
if (project != null) {
issueBuilder.setProject(project.getDbKey());
.setParam(PARAM_BRANCH, branch.getBranch())
.executeProtobuf(SearchWsResponse.class);
- assertThat(result.getIssuesList()).extracting(Issues.Issue::getKey)
- .containsExactlyInAnyOrder(branchIssue.getKey())
- .doesNotContain(projectIssue.getKey());
- assertThat(result.getComponentsList()).extracting(Issues.Component::getKey, Issues.Component::getBranch)
+ assertThat(result.getIssuesList())
+ .extracting(Issue::getKey, Issue::getComponent, Issue::getBranch)
+ .containsExactlyInAnyOrder(tuple(branchIssue.getKey(), branchFile.getKey(), branchFile.getBranch()));
+ assertThat(result.getComponentsList())
+ .extracting(Issues.Component::getKey, Issues.Component::getBranch)
.containsExactlyInAnyOrder(
tuple(branchFile.getKey(), branchFile.getBranch()),
tuple(branch.getKey(), branch.getBranch()));
SearchWsResponse result = ws.newRequest().executeProtobuf(SearchWsResponse.class);
- assertThat(result.getIssuesList()).extracting(Issues.Issue::getKey)
+ assertThat(result.getIssuesList()).extracting(Issue::getKey)
.containsExactlyInAnyOrder(projectIssue.getKey())
.doesNotContain(branchIssue.getKey());
}
}
message Issue {
- optional string organization = 29;
optional string key = 1;
optional string rule = 2;
optional sonarqube.ws.commons.Severity severity = 3;
optional string closeDate = 26;
optional sonarqube.ws.commons.RuleType type = 27;
+
+ optional string organization = 29;
+ optional string branch = 30;
}
message Transitions {