File tree 1 file changed +8
-2
lines changed
src/test/java/org/dataloader
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -831,19 +831,25 @@ public void should_Batch_loads_occurring_within_futures() {
831
831
832
832
Supplier <Object > nullValue = () -> null ;
833
833
834
+ AtomicBoolean v4Called = new AtomicBoolean ();
835
+
834
836
CompletableFuture .supplyAsync (nullValue ).thenAccept (v1 -> {
835
837
identityLoader .load ("a" );
836
838
CompletableFuture .supplyAsync (nullValue ).thenAccept (v2 -> {
837
839
identityLoader .load ("b" );
838
840
CompletableFuture .supplyAsync (nullValue ).thenAccept (v3 -> {
839
841
identityLoader .load ("c" );
840
842
CompletableFuture .supplyAsync (nullValue ).thenAccept (
841
- v4 ->
842
- identityLoader .load ("d" ));
843
+ v4 -> {
844
+ identityLoader .load ("d" );
845
+ v4Called .set (true );
846
+ });
843
847
});
844
848
});
845
849
});
846
850
851
+ await ().untilTrue (v4Called );
852
+
847
853
identityLoader .dispatchAndJoin ();
848
854
849
855
assertThat (loadCalls , equalTo (
You can’t perform that action at this time.
0 commit comments