]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4304 allow to flag manual issues as false-positive
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 3 Jun 2013 14:25:25 +0000 (16:25 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 3 Jun 2013 14:36:33 +0000 (16:36 +0200)
sonar-core/src/main/java/org/sonar/core/issue/workflow/IssueWorkflow.java
sonar-core/src/test/java/org/sonar/core/issue/workflow/IssueWorkflowTest.java

index 12a8318fadf389d52cdb14f0f3f5e63bfb12c6e2..acc539876daa3d63d96aa2ea0313f4d519afc74c 100644 (file)
@@ -85,17 +85,14 @@ public class IssueWorkflow implements BatchComponent, ServerComponent, Startable
         // resolve as false-positive
       .transition(Transition.builder(DefaultTransitions.FALSE_POSITIVE)
         .from(Issue.STATUS_OPEN).to(Issue.STATUS_RESOLVED)
-        .conditions(new IsManual(false))
         .functions(new SetResolution(Issue.RESOLUTION_FALSE_POSITIVE), SetAssignee.UNASSIGN)
         .build())
       .transition(Transition.builder(DefaultTransitions.FALSE_POSITIVE)
         .from(Issue.STATUS_REOPENED).to(Issue.STATUS_RESOLVED)
-        .conditions(new IsManual(false))
         .functions(new SetResolution(Issue.RESOLUTION_FALSE_POSITIVE), SetAssignee.UNASSIGN)
         .build())
       .transition(Transition.builder(DefaultTransitions.FALSE_POSITIVE)
         .from(Issue.STATUS_CONFIRMED).to(Issue.STATUS_RESOLVED)
-        .conditions(new IsManual(false))
         .functions(new SetResolution(Issue.RESOLUTION_FALSE_POSITIVE), SetAssignee.UNASSIGN)
         .build())
 
@@ -128,7 +125,7 @@ public class IssueWorkflow implements BatchComponent, ServerComponent, Startable
         .build())
       .transition(Transition.builder("automaticclosemanual")
         .from(Issue.STATUS_RESOLVED).to(Issue.STATUS_CLOSED)
-        .conditions(new IsEndOfLife(false), new HasResolution(Issue.RESOLUTION_FIXED), new IsManual(true))
+        .conditions(new IsEndOfLife(false), new IsManual(true))
         .functions(new SetCloseDate(true))
         .automatic()
         .build())
index eda0b11523ac0ec248f26de437f1e7bfe232d3fe..5d21f7767ef656579b9b4adb90ee6e9af841016e 100644 (file)
@@ -240,7 +240,8 @@ public class IssueWorkflowTest {
 
     assertThat(workflow.outTransitions(issue)).containsOnly(
       Transition.create("confirm", "OPEN", "CONFIRMED"),
-      Transition.create("resolve", "OPEN", "RESOLVED")
+      Transition.create("resolve", "OPEN", "RESOLVED"),
+      Transition.create("falsepositive", "OPEN", "RESOLVED")
     );
 
     workflow.doTransition(issue, "resolve", mock(IssueChangeContext.class));
@@ -269,7 +270,8 @@ public class IssueWorkflowTest {
 
     assertThat(workflow.outTransitions(issue)).containsOnly(
       Transition.create("confirm", "OPEN", "CONFIRMED"),
-      Transition.create("resolve", "OPEN", "RESOLVED")
+      Transition.create("resolve", "OPEN", "RESOLVED"),
+      Transition.create("falsepositive", "OPEN", "RESOLVED")
     );
 
     workflow.doTransition(issue, "confirm", mock(IssueChangeContext.class));
@@ -278,7 +280,8 @@ public class IssueWorkflowTest {
 
     assertThat(workflow.outTransitions(issue)).containsOnly(
       Transition.create("unconfirm", "CONFIRMED", "REOPENED"),
-      Transition.create("resolve", "CONFIRMED", "RESOLVED")
+      Transition.create("resolve", "CONFIRMED", "RESOLVED"),
+      Transition.create("falsepositive", "CONFIRMED", "RESOLVED")
     );
 
     // keep confirmed and unresolved