use of org.sonarqube.ws.Issues.TagsResponse in project sonarqube by SonarSource.
the class TagsActionTest method return_limited_size.
@Test
public void return_limited_size() {
RuleDefinitionDto rule = db.rules().insertIssueRule();
ComponentDto project = db.components().insertPrivateProject();
db.issues().insertIssue(rule, project, project, issue -> issue.setTags(asList("tag1", "tag2")));
db.issues().insertIssue(rule, project, project, issue -> issue.setTags(asList("tag3", "tag4", "tag5")));
indexIssues();
permissionIndexer.allowOnlyAnyone(project);
TagsResponse result = ws.newRequest().setParam("ps", "2").executeProtobuf(TagsResponse.class);
assertThat(result.getTagsList()).containsExactly("tag1", "tag2");
}
use of org.sonarqube.ws.Issues.TagsResponse in project sonarqube by SonarSource.
the class TagsActionTest method do_not_return_issues_without_permission.
@Test
public void do_not_return_issues_without_permission() {
RuleDefinitionDto rule = db.rules().insertIssueRule();
ComponentDto project1 = db.components().insertPrivateProject();
ComponentDto project2 = db.components().insertPrivateProject();
db.issues().insertIssue(rule, project1, project1, issue -> issue.setTags(asList("tag1", "tag2")));
db.issues().insertIssue(rule, project2, project2, issue -> issue.setTags(asList("tag3", "tag4", "tag5")));
indexIssues();
// Project 2 is not visible to current user
permissionIndexer.allowOnlyAnyone(project1);
TagsResponse result = ws.newRequest().executeProtobuf(TagsResponse.class);
assertThat(result.getTagsList()).containsExactly("tag1", "tag2");
}
use of org.sonarqube.ws.Issues.TagsResponse in project sonarqube by SonarSource.
the class TagsActionTest method empty_list.
@Test
public void empty_list() {
TagsResponse result = ws.newRequest().executeProtobuf(TagsResponse.class);
assertThat(result.getTagsList()).isEmpty();
}
use of org.sonarqube.ws.Issues.TagsResponse in project sonarqube by SonarSource.
the class TagsActionTest method search_tags.
@Test
public void search_tags() {
RuleDefinitionDto rule = db.rules().insertIssueRule();
ComponentDto project = db.components().insertPrivateProject();
db.issues().insertIssue(rule, project, project, issue -> issue.setTags(asList("tag1", "tag2")));
db.issues().insertIssue(rule, project, project, issue -> issue.setTags(asList("tag3", "tag4", "tag5")));
indexIssues();
permissionIndexer.allowOnlyAnyone(project);
TagsResponse result = ws.newRequest().executeProtobuf(TagsResponse.class);
assertThat(result.getTagsList()).containsExactly("tag1", "tag2", "tag3", "tag4", "tag5");
verify(issueIndexSyncProgressChecker).checkIfIssueSyncInProgress(any());
}
Aggregations