}
@Test
public void manual_issues_should_be_confirmed_then_kept_open() throws Exception {
// Manual issue because of reporter
DefaultIssue issue = new DefaultIssue()
.setKey("ABCDE")
.setStatus(Issue.STATUS_OPEN)
.setRuleKey(RuleKey.of("manual", "Performance"))
.setReporter("simon");
workflow.start();
assertThat(workflow.outTransitions(issue)).containsOnly(
Transition.create("confirm", "OPEN", "CONFIRMED"),
Transition.create("resolve", "OPEN", "RESOLVED"),
Transition.create("falsepositive", "OPEN", "RESOLVED")
);
workflow.doTransition(issue, "confirm", mock(IssueChangeContext.class));
assertThat(issue.resolution()).isNull();
assertThat(issue.status()).isEqualTo("CONFIRMED");
assertThat(workflow.outTransitions(issue)).containsOnly(
Transition.create("unconfirm", "CONFIRMED", "REOPENED"),
Transition.create("resolve", "CONFIRMED", "RESOLVED"),
Transition.create("falsepositive", "CONFIRMED", "RESOLVED")
);
// keep confirmed and unresolved
workflow.doAutomaticTransition(issue, mock(IssueChangeContext.class));
assertThat(issue.resolution()).isNull();
assertThat(issue.status()).isEqualTo("CONFIRMED");
// unconfirm
workflow.doTransition(issue, "unconfirm", mock(IssueChangeContext.class));
assertThat(issue.resolution()).isNull();
assertThat(issue.status()).isEqualTo("REOPENED");
}