2020import java .time .Instant ;
2121import java .util .List ;
2222import java .util .Map ;
23+ import java .util .concurrent .TimeoutException ;
2324
2425import static org .junit .jupiter .api .Assertions .assertEquals ;
2526import static org .junit .jupiter .api .Assertions .assertFalse ;
@@ -470,10 +471,10 @@ public void evalStructureErrorTest() {
470471 }
471472
472473 @ Test
473- public void trackWithDetailsTest () {
474+ public void trackWithDetailsTest () throws InterruptedException , TimeoutException {
474475 SplitProvider provider = new SplitProvider (mockSplitClient );
475476
476-
477+ verify ( mockSplitClient ). blockUntilReady ();
477478 EvaluationContext ctx = new MutableContext (key ).add ("trafficType" , "user" );
478479 TrackingEventDetails details = new MutableTrackingEventDetails (42.5 )
479480 .add ("plan" , new Value ("pro" ))
@@ -491,38 +492,41 @@ public void trackWithDetailsTest() {
491492 }
492493
493494 @ Test
494- public void trackTargetingKeyErrorTest () {
495+ public void trackTargetingKeyErrorTest () throws InterruptedException , TimeoutException {
495496 // Tracking without targetingKey should throw error
496497 SplitProvider provider = new SplitProvider (mockSplitClient );
497498 EvaluationContext ctx = new MutableContext ().add ("trafficType" , "user" );
498499
499500 assertThrows (dev .openfeature .sdk .exceptions .TargetingKeyMissingError .class ,
500501 () -> provider .track ("purchase" , ctx , null ));
501- verifyNoInteractions (mockSplitClient );
502+ verify (mockSplitClient ).blockUntilReady ();
503+ verifyNoMoreInteractions (mockSplitClient );
502504 }
503505
504506 @ Test
505- public void trackEventNameErrorTest () {
507+ public void trackEventNameErrorTest () throws InterruptedException , TimeoutException {
506508 // Tracking without eventName should throw error
507509 SplitProvider provider = new SplitProvider (mockSplitClient );
508510 EvaluationContext ctx = new MutableContext (key ).add ("trafficType" , "user" );
509511
510512 GeneralError ex = assertThrows (GeneralError .class ,
511513 () -> provider .track (" " , ctx , null )); // blank name
512514 assertTrue (ex .getMessage ().toLowerCase ().contains ("eventname" ));
513- verifyNoInteractions (mockSplitClient );
515+ verify (mockSplitClient ).blockUntilReady ();
516+ verifyNoMoreInteractions (mockSplitClient );
514517 }
515518
516519 @ Test
517- public void trackTrafficTypeErrorTest () {
520+ public void trackTrafficTypeErrorTest () throws InterruptedException , TimeoutException {
518521 // Tracking without trafficType should throw error
519522 SplitProvider provider = new SplitProvider (mockSplitClient );
520523 EvaluationContext ctx = new MutableContext (key );
521524
522525 GeneralError ex = assertThrows (GeneralError .class ,
523526 () -> provider .track ("purchase" , ctx , null ));
524527 assertTrue (ex .getMessage ().toLowerCase ().contains ("traffictype" ));
525- verifyNoInteractions (mockSplitClient );
528+ verify (mockSplitClient ).blockUntilReady ();
529+ verifyNoMoreInteractions (mockSplitClient );
526530 }
527531
528532 @ Test
0 commit comments