aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java')
-rw-r--r--sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java b/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
index e44fa62511e..92dd370ae72 100644
--- a/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/purge/PurgeDaoTest.java
@@ -33,8 +33,10 @@ import org.sonar.db.ce.CeQueueDto;
import org.sonar.db.component.ComponentDto;
import org.sonar.db.component.ComponentTesting;
+import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.sonar.db.ce.CeTaskTypes.REPORT;
@@ -171,9 +173,13 @@ public class PurgeDaoTest {
@Test
public void should_delete_old_closed_issues() {
+ PurgeListener purgeListener = mock(PurgeListener.class);
dbTester.prepareDbUnit(getClass(), "should_delete_old_closed_issues.xml");
- underTest.purge(newConfigurationWith30Days(), PurgeListener.EMPTY, new PurgeProfiler());
+
+ underTest.purge(newConfigurationWith30Days(), purgeListener, new PurgeProfiler());
+
dbTester.assertDbUnit(getClass(), "should_delete_old_closed_issues-result.xml", "issues", "issue_changes");
+ verify(purgeListener).onIssuesRemoval(asList("ISSUE-1", "ISSUE-2"));
}
@Test