aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-core
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2020-07-08 09:37:12 -0500
committersonartech <sonartech@sonarsource.com>2020-07-10 20:05:50 +0000
commita59e6e96ad22300a795b4b6b5122da06b9623922 (patch)
tree0c3e8bc224bebbb18cf63e787cbf006f55d55609 /server/sonar-webserver-core
parenteb451f2c3aafc231cf05c81ff3e94f73b98ee586 (diff)
downloadsonarqube-a59e6e96ad22300a795b4b6b5122da06b9623922.tar.gz
sonarqube-a59e6e96ad22300a795b4b6b5122da06b9623922.zip
Fix unstable unit test
Diffstat (limited to 'server/sonar-webserver-core')
-rw-r--r--server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationDaemonTest.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationDaemonTest.java b/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationDaemonTest.java
index 79486378771..cfb261e2c77 100644
--- a/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationDaemonTest.java
+++ b/server/sonar-webserver-core/src/test/java/org/sonar/server/notification/NotificationDaemonTest.java
@@ -34,6 +34,7 @@ import static java.util.Collections.singleton;
import static org.mockito.ArgumentMatchers.anyCollection;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class NotificationDaemonTest {
@@ -71,7 +72,9 @@ public class NotificationDaemonTest {
when(manager.getFromQueue()).thenReturn(notification).thenReturn(null);
underTest.start();
- inOrder.verify(notificationService, timeout(2000)).deliverEmails(singleton(notification));
+ verify(notificationService, timeout(2000)).deliver(notification);
+
+ inOrder.verify(notificationService).deliverEmails(singleton(notification));
inOrder.verify(notificationService).deliver(notification);
inOrder.verifyNoMoreInteractions();
underTest.stop();
@@ -91,13 +94,15 @@ public class NotificationDaemonTest {
.thenReturn(null);
underTest.start();
- inOrder.verify(notificationService, timeout(2000)).deliverEmails(singleton(notification1));
+ verify(notificationService, timeout(2000)).deliver(notification1);
+
+ inOrder.verify(notificationService).deliverEmails(singleton(notification1));
inOrder.verify(notificationService).deliver(notification1);
- inOrder.verify(notificationService, timeout(2000)).deliverEmails(singleton(notification2));
+ inOrder.verify(notificationService).deliverEmails(singleton(notification2));
inOrder.verify(notificationService).deliver(notification2);
- inOrder.verify(notificationService, timeout(2000)).deliverEmails(singleton(notification3));
+ inOrder.verify(notificationService).deliverEmails(singleton(notification3));
inOrder.verify(notificationService).deliver(notification3);
- inOrder.verify(notificationService, timeout(2000)).deliverEmails(singleton(notification4));
+ inOrder.verify(notificationService).deliverEmails(singleton(notification4));
inOrder.verify(notificationService).deliver(notification4);
inOrder.verifyNoMoreInteractions();
underTest.stop();