File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/test/java/org/dataloader Expand file tree Collapse file tree 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() {
831831
832832 Supplier <Object > nullValue = () -> null ;
833833
834+ AtomicBoolean v4Called = new AtomicBoolean ();
835+
834836 CompletableFuture .supplyAsync (nullValue ).thenAccept (v1 -> {
835837 identityLoader .load ("a" );
836838 CompletableFuture .supplyAsync (nullValue ).thenAccept (v2 -> {
837839 identityLoader .load ("b" );
838840 CompletableFuture .supplyAsync (nullValue ).thenAccept (v3 -> {
839841 identityLoader .load ("c" );
840842 CompletableFuture .supplyAsync (nullValue ).thenAccept (
841- v4 ->
842- identityLoader .load ("d" ));
843+ v4 -> {
844+ identityLoader .load ("d" );
845+ v4Called .set (true );
846+ });
843847 });
844848 });
845849 });
846850
851+ await ().untilTrue (v4Called );
852+
847853 identityLoader .dispatchAndJoin ();
848854
849855 assertThat (loadCalls , equalTo (
You can’t perform that action at this time.
0 commit comments