@@ -339,7 +339,7 @@ public void testDirectWithEmptyNotification() {
339
339
}
340
340
341
341
@ Test
342
- public void testSessionUpgradeFromAppClosed () {
342
+ public void testSessionUpgradeFromAppClosed () throws Exception {
343
343
trackerFactory .saveInfluenceParams (new OneSignalPackagePrivateHelper .RemoteOutcomeParams ());
344
344
sessionManager .initSessionFromCache ();
345
345
@@ -369,6 +369,7 @@ public void testSessionUpgradeFromAppClosed() {
369
369
}
370
370
371
371
sessionManager .attemptSessionUpgrade (OneSignal .AppEntryAction .APP_CLOSE );
372
+ threadAndTaskWait ();
372
373
373
374
influences = sessionManager .getInfluences ();
374
375
@@ -390,7 +391,7 @@ public void testSessionUpgradeFromAppClosed() {
390
391
}
391
392
392
393
@ Test
393
- public void testSessionUpgradeFromUnattributedToIndirect () throws JSONException {
394
+ public void testSessionUpgradeFromUnattributedToIndirect () throws Exception {
394
395
trackerFactory .saveInfluenceParams (new OneSignalPackagePrivateHelper .RemoteOutcomeParams ());
395
396
sessionManager .initSessionFromCache ();
396
397
@@ -420,6 +421,7 @@ public void testSessionUpgradeFromUnattributedToIndirect() throws JSONException
420
421
}
421
422
422
423
sessionManager .attemptSessionUpgrade (OneSignal .AppEntryAction .APP_OPEN );
424
+ threadAndTaskWait ();
423
425
424
426
influences = sessionManager .getInfluences ();
425
427
@@ -439,7 +441,7 @@ public void testSessionUpgradeFromUnattributedToIndirect() throws JSONException
439
441
}
440
442
441
443
@ Test
442
- public void testSessionUpgradeFromUnattributedToDirectNotification () throws JSONException {
444
+ public void testSessionUpgradeFromUnattributedToDirectNotification () throws Exception {
443
445
trackerFactory .saveInfluenceParams (new OneSignalPackagePrivateHelper .RemoteOutcomeParams ());
444
446
sessionManager .initSessionFromCache ();
445
447
@@ -452,6 +454,7 @@ public void testSessionUpgradeFromUnattributedToDirectNotification() throws JSON
452
454
sessionManager .onNotificationReceived (GENERIC_ID );
453
455
sessionManager .onInAppMessageReceived (GENERIC_ID );
454
456
sessionManager .onDirectInfluenceFromNotificationOpen (GENERIC_ID );
457
+ threadAndTaskWait ();
455
458
456
459
iamInfluences = trackerFactory .getIAMChannelTracker ().getCurrentSessionInfluence ();
457
460
notificationInfluences = trackerFactory .getNotificationChannelTracker ().getCurrentSessionInfluence ();
@@ -474,7 +477,7 @@ public void testSessionUpgradeFromUnattributedToDirectNotification() throws JSON
474
477
}
475
478
476
479
@ Test
477
- public void testSessionUpgradeFromIndirectToDirect () throws JSONException {
480
+ public void testSessionUpgradeFromIndirectToDirect () throws Exception {
478
481
trackerFactory .saveInfluenceParams (new OneSignalPackagePrivateHelper .RemoteOutcomeParams ());
479
482
sessionManager .initSessionFromCache ();
480
483
@@ -490,6 +493,7 @@ public void testSessionUpgradeFromIndirectToDirect() throws JSONException {
490
493
assertEquals (GENERIC_ID , notificationInfluences .getIds ().get (0 ));
491
494
492
495
sessionManager .onDirectInfluenceFromNotificationOpen (NOTIFICATION_ID );
496
+ threadAndTaskWait ();
493
497
494
498
iamInfluences = trackerFactory .getIAMChannelTracker ().getCurrentSessionInfluence ();
495
499
notificationInfluences = trackerFactory .getNotificationChannelTracker ().getCurrentSessionInfluence ();
@@ -513,7 +517,7 @@ public void testSessionUpgradeFromIndirectToDirect() throws JSONException {
513
517
}
514
518
515
519
@ Test
516
- public void testSessionUpgradeFromDirectToDirectDifferentID () throws JSONException {
520
+ public void testSessionUpgradeFromDirectToDirectDifferentID () throws Exception {
517
521
trackerFactory .saveInfluenceParams (new OneSignalPackagePrivateHelper .RemoteOutcomeParams ());
518
522
sessionManager .initSessionFromCache ();
519
523
@@ -527,6 +531,7 @@ public void testSessionUpgradeFromDirectToDirectDifferentID() throws JSONExcepti
527
531
528
532
sessionManager .onNotificationReceived (NOTIFICATION_ID );
529
533
sessionManager .onDirectInfluenceFromNotificationOpen (NOTIFICATION_ID );
534
+ threadAndTaskWait ();
530
535
531
536
notificationInfluences = trackerFactory .getNotificationChannelTracker ().getCurrentSessionInfluence ();
532
537
@@ -543,7 +548,7 @@ public void testSessionUpgradeFromDirectToDirectDifferentID() throws JSONExcepti
543
548
}
544
549
545
550
@ Test
546
- public void testSessionUpgradeFromDirectToDirectSameID () throws JSONException {
551
+ public void testSessionUpgradeFromDirectToDirectSameID () throws Exception {
547
552
trackerFactory .saveInfluenceParams (new OneSignalPackagePrivateHelper .RemoteOutcomeParams ());
548
553
sessionManager .initSessionFromCache ();
549
554
@@ -556,6 +561,7 @@ public void testSessionUpgradeFromDirectToDirectSameID() throws JSONException {
556
561
assertEquals (GENERIC_ID , notificationInfluences .getIds ().get (0 ));
557
562
558
563
sessionManager .attemptSessionUpgrade (OneSignal .AppEntryAction .NOTIFICATION_CLICK );
564
+ threadAndTaskWait ();
559
565
560
566
notificationInfluences = trackerFactory .getNotificationChannelTracker ().getCurrentSessionInfluence ();
561
567
@@ -571,14 +577,15 @@ public void testSessionUpgradeFromDirectToDirectSameID() throws JSONException {
571
577
}
572
578
573
579
@ Test
574
- public void testSessionUpgradeFromDirectToDirectEndChannelsDirect () throws JSONException {
580
+ public void testSessionUpgradeFromDirectToDirectEndChannelsDirect () throws Exception {
575
581
trackerFactory .saveInfluenceParams (new OneSignalPackagePrivateHelper .RemoteOutcomeParams ());
576
582
sessionManager .initSessionFromCache ();
577
583
578
584
sessionManager .onNotificationReceived (GENERIC_ID );
579
585
sessionManager .onDirectInfluenceFromNotificationOpen (GENERIC_ID );
580
586
sessionManager .onInAppMessageReceived (IAM_ID );
581
587
sessionManager .onDirectInfluenceFromIAMClick (IAM_ID );
588
+ threadAndTaskWait ();
582
589
583
590
OSInfluence iamInfluences = trackerFactory .getIAMChannelTracker ().getCurrentSessionInfluence ();
584
591
OSInfluence notificationInfluences = trackerFactory .getNotificationChannelTracker ().getCurrentSessionInfluence ();
@@ -589,6 +596,7 @@ public void testSessionUpgradeFromDirectToDirectEndChannelsDirect() throws JSONE
589
596
assertEquals (GENERIC_ID , notificationInfluences .getIds ().get (0 ));
590
597
591
598
sessionManager .onDirectInfluenceFromNotificationOpen (NOTIFICATION_ID );
599
+ threadAndTaskWait ();
592
600
593
601
iamInfluences = trackerFactory .getIAMChannelTracker ().getCurrentSessionInfluence ();
594
602
notificationInfluences = trackerFactory .getNotificationChannelTracker ().getCurrentSessionInfluence ();
0 commit comments