@@ -110,10 +110,11 @@ public void should_Return_zero_entries_dispatched_when_no_keys_supplied() {
110110 assertThat (promisedValues .size (), is (0 ));
111111 success .set (true );
112112 });
113- DataLoaderHelper . DispatchResult dispatchResult = identityLoader .dispatchWithCounts ();
113+ DispatchResult dispatchResult = identityLoader .dispatchWithCounts ();
114114 await ().untilAtomic (success , is (true ));
115- assertThat (dispatchResult .totalEntriesHandled , equalTo (0 ));
115+ assertThat (dispatchResult .getKeysCount () , equalTo (0 ));
116116 }
117+
117118 @ Test
118119 public void should_Batch_multiple_requests () throws ExecutionException , InterruptedException {
119120 List <Collection <Integer >> loadCalls = new ArrayList <>();
@@ -126,19 +127,22 @@ public void should_Batch_multiple_requests() throws ExecutionException, Interrup
126127 await ().until (() -> future1 .isDone () && future2 .isDone ());
127128 assertThat (future1 .get (), equalTo (1 ));
128129 assertThat (future2 .get (), equalTo (2 ));
129- assertThat (loadCalls , equalTo (singletonList (asList (1 , 2 )))); }
130+ assertThat (loadCalls , equalTo (singletonList (asList (1 , 2 ))));
131+ }
130132
131133 @ Test
132134 public void should_Return_number_of_batched_entries () throws ExecutionException , InterruptedException {
133135 List <Collection <Integer >> loadCalls = new ArrayList <>();
134136 DataLoader <Integer , Integer > identityLoader = idLoader (new DataLoaderOptions (), loadCalls );
135137
136138 CompletableFuture <Integer > future1 = identityLoader .load (1 );
139+ CompletableFuture <Integer > future1a = identityLoader .load (1 );
137140 CompletableFuture <Integer > future2 = identityLoader .load (2 );
138- DataLoaderHelper . DispatchResult dispatchResult = identityLoader .dispatchWithCounts ();
141+ DispatchResult <?> dispatchResult = identityLoader .dispatchWithCounts ();
139142
140143 await ().until (() -> future1 .isDone () && future2 .isDone ());
141- assertThat (dispatchResult .totalEntriesHandled , equalTo (2 ));
144+ assertThat (dispatchResult .getKeysCount (), equalTo (2 )); // its two because its the number dispatched (by key) not the load calls
145+ assertThat (dispatchResult .getPromisedResults ().isDone (), equalTo (true ));
142146 }
143147
144148 @ Test
0 commit comments