aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-08-16 11:25:33 +0200
committerSonarTech <sonartech@sonarsource.com>2018-08-21 20:21:05 +0200
commit8b7e1456368921a8e7cebde1eebf02832dd8e5b5 (patch)
tree80f77f81a2a91d638f20c47b105fbb6798a71e6b
parent3065f6824c72d504c8e317c7d2d6a2c682081c4f (diff)
downloadsonarqube-8b7e1456368921a8e7cebde1eebf02832dd8e5b5.tar.gz
sonarqube-8b7e1456368921a8e7cebde1eebf02832dd8e5b5.zip
SONAR-8368 unset closeDate when reopening Closed issues
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java4
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowTest.java2
2 files changed, 6 insertions, 0 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java
index fb27f0d5853..052acd43f9a 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/workflow/IssueWorkflow.java
@@ -250,6 +250,7 @@ public class IssueWorkflow implements Startable {
new PreviousStatusWas(Issue.STATUS_OPEN),
new HasResolution(Issue.RESOLUTION_REMOVED, Issue.RESOLUTION_FIXED),
IsNotHotspotNorManualVulnerability.INSTANCE)
+ .functions(UnsetCloseDate.INSTANCE)
.automatic()
.build())
.transition(Transition.builder("automaticunclosereopen")
@@ -258,6 +259,7 @@ public class IssueWorkflow implements Startable {
new PreviousStatusWas(Issue.STATUS_REOPENED),
new HasResolution(Issue.RESOLUTION_REMOVED, Issue.RESOLUTION_FIXED),
IsNotHotspotNorManualVulnerability.INSTANCE)
+ .functions(UnsetCloseDate.INSTANCE)
.automatic()
.build())
.transition(Transition.builder("automaticuncloseconfirmed")
@@ -266,6 +268,7 @@ public class IssueWorkflow implements Startable {
new PreviousStatusWas(Issue.STATUS_CONFIRMED),
new HasResolution(Issue.RESOLUTION_REMOVED, Issue.RESOLUTION_FIXED),
IsNotHotspotNorManualVulnerability.INSTANCE)
+ .functions(UnsetCloseDate.INSTANCE)
.automatic()
.build())
.transition(Transition.builder("automaticuncloseresolved")
@@ -274,6 +277,7 @@ public class IssueWorkflow implements Startable {
new PreviousStatusWas(Issue.STATUS_RESOLVED),
new HasResolution(Issue.RESOLUTION_REMOVED, Issue.RESOLUTION_FIXED),
IsNotHotspotNorManualVulnerability.INSTANCE)
+ .functions(UnsetCloseDate.INSTANCE)
.automatic()
.build())
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowTest.java
index c515234fd08..c848d059559 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/workflow/IssueWorkflowTest.java
@@ -201,6 +201,8 @@ public class IssueWorkflowTest {
assertThat(issue.status()).isEqualTo(previousStatus);
assertThat(issue.updateDate()).isEqualTo(DateUtils.truncate(now, Calendar.SECOND));
+ assertThat(issue.closeDate()).isNull();
+ assertThat(issue.isChanged()).isTrue();
});
}