Skip to content

Commit 4df7b32

Browse files
committed
Fix shouldUpdateBadgesWhenDismissingNotification
* This test was flaky as it wasn't waiting for the service to display the notification.
1 parent 720893f commit 4df7b32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

OneSignalSDK/unittest/src/test/java/com/test/onesignal/GenerateNotificationRunner.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,10 @@ private void runImplicitServices() throws Exception {
719719

720720
@Test
721721
@Config(shadows = { ShadowGenerateNotification.class })
722-
public void shouldUpdateBadgesWhenDismissingNotification() {
722+
public void shouldUpdateBadgesWhenDismissingNotification() throws Exception {
723723
Bundle bundle = getBaseNotifBundle();
724724
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle);
725+
threadAndTaskWait();
725726
assertEquals(notifMessage, ShadowRoboNotificationManager.getLastShadowNotif().getContentText());
726727
assertEquals(1, ShadowBadgeCountUpdater.lastCount);
727728

0 commit comments

Comments
 (0)