Merge pull request #9640 from thingsboard/fix/notifications-count-test
Improve flaky test
This commit is contained in:
commit
0983ec7044
@ -113,15 +113,13 @@ public class NotificationApiTest extends AbstractNotificationApiTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSubscribingToUnreadNotificationsCount() {
|
public void testSubscribingToUnreadNotificationsCount() {
|
||||||
|
wsClient.subscribeForUnreadNotificationsCount().waitForReply(true);
|
||||||
NotificationTarget notificationTarget = createNotificationTarget(customerUserId);
|
NotificationTarget notificationTarget = createNotificationTarget(customerUserId);
|
||||||
String notificationText1 = "Notification 1";
|
String notificationText1 = "Notification 1";
|
||||||
submitNotificationRequest(notificationTarget.getId(), notificationText1);
|
submitNotificationRequest(notificationTarget.getId(), notificationText1);
|
||||||
String notificationText2 = "Notification 2";
|
String notificationText2 = "Notification 2";
|
||||||
submitNotificationRequest(notificationTarget.getId(), notificationText2);
|
submitNotificationRequest(notificationTarget.getId(), notificationText2);
|
||||||
|
|
||||||
wsClient.subscribeForUnreadNotificationsCount();
|
|
||||||
wsClient.waitForReply(true);
|
|
||||||
|
|
||||||
await().atMost(2, TimeUnit.SECONDS)
|
await().atMost(2, TimeUnit.SECONDS)
|
||||||
.until(() -> wsClient.getLastCountUpdate().getTotalUnreadCount() == 2);
|
.until(() -> wsClient.getLastCountUpdate().getTotalUnreadCount() == 2);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user