]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3755 set the update date when scan changes status
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 16 May 2013 12:39:05 +0000 (14:39 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 16 May 2013 12:39:05 +0000 (14:39 +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 e5cd259df00a0d55baf892fd55d2ed24f65f66db..9ce287a3d599fa1ff7602d4e45c18e9ea1f1b54b 100644 (file)
@@ -125,6 +125,7 @@ public class IssueWorkflow implements BatchComponent, ServerComponent, Startable
     if (transition != null) {
       functionExecutor.execute(transition.functions(), issue, issueChangeContext);
       issue.setStatus(transition.to());
+      issue.setUpdateDate(issueChangeContext.date());
     }
   }
 
index e74f5cdac10259a570c7984ecfcee2519ec31ff1..0174a36c2e881a84368668aee4155c994623a6ae 100644 (file)
@@ -70,10 +70,12 @@ public class IssueWorkflowTest {
       .setStatus(Issue.STATUS_RESOLVED)
       .setNew(false)
       .setAlive(false);
-    workflow.doAutomaticTransition(issue, IssueChangeContext.createScan(new Date()));
+    Date now = new Date();
+    workflow.doAutomaticTransition(issue, IssueChangeContext.createScan(now));
     assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FIXED);
     assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED);
     assertThat(issue.closeDate()).isNotNull();
+    assertThat(issue.updateDate()).isEqualTo(now);
   }
 
   @Test