use of org.sonar.server.issue.workflow.Transition in project sonarqube by SonarSource.
the class TransitionServiceTest method list_transitions.
@Test
public void list_transitions() throws Exception {
IssueDto issue = newIssue().setStatus(STATUS_OPEN).setResolution(null);
userSession.logIn("john").addProjectUuidPermissions(ISSUE_ADMIN, issue.getProjectUuid());
List<Transition> result = underTest.listTransitions(issue.toDefaultIssue());
assertThat(result).extracting(Transition::key).containsOnly("confirm", "resolve", "falsepositive", "wontfix");
}
use of org.sonar.server.issue.workflow.Transition in project sonarqube by SonarSource.
the class TransitionServiceTest method list_transitions_returns_only_transitions_that_do_not_requires_issue_admin_permission.
@Test
public void list_transitions_returns_only_transitions_that_do_not_requires_issue_admin_permission() throws Exception {
userSession.logIn("john");
IssueDto issue = newIssue().setStatus(STATUS_OPEN).setResolution(null);
List<Transition> result = underTest.listTransitions(issue.toDefaultIssue());
assertThat(result).extracting(Transition::key).containsOnly("confirm", "resolve");
}
use of org.sonar.server.issue.workflow.Transition in project sonarqube by SonarSource.
the class TransitionServiceTest method list_transitions_returns_nothing_when_not_logged.
@Test
public void list_transitions_returns_nothing_when_not_logged() throws Exception {
IssueDto issue = newIssue().setStatus(STATUS_OPEN).setResolution(null);
List<Transition> result = underTest.listTransitions(issue.toDefaultIssue());
assertThat(result).isEmpty();
}
use of org.sonar.server.issue.workflow.Transition in project sonarqube by SonarSource.
the class SearchResponseFormat method formatIssueTransitions.
private static void formatIssueTransitions(SearchResponseData data, Issues.Issue.Builder wsIssue, IssueDto dto) {
Issues.Transitions.Builder wsTransitions = Issues.Transitions.newBuilder();
List<Transition> transitions = data.getTransitionsForIssueKey(dto.getKey());
if (transitions != null) {
for (Transition transition : transitions) {
wsTransitions.addTransitions(transition.key());
}
}
wsIssue.setTransitions(wsTransitions);
}
Aggregations