3535import static java .util .Collections .emptyList ;
3636import static java .util .Collections .singletonList ;
3737import static org .awaitility .Awaitility .await ;
38- import static org .dataloader .DataLoaderFactory .* ;
38+ import static org .dataloader .DataLoaderFactory .newDataLoader ;
3939import static org .dataloader .DataLoaderOptions .newOptions ;
4040import static org .dataloader .TestKit .listFrom ;
4141import static org .dataloader .impl .CompletableFutureKit .cause ;
@@ -244,7 +244,9 @@ public void should_Clear_single_value_in_loader() throws ExecutionException, Int
244244 assertThat (future2 .get (), equalTo ("B" ));
245245 assertThat (loadCalls , equalTo (singletonList (asList ("A" , "B" ))));
246246
247- identityLoader .clear ("A" );
247+ // fluency
248+ DataLoader <String , String > dl = identityLoader .clear ("A" );
249+ assertThat (dl , equalTo (identityLoader ));
248250
249251 CompletableFuture <String > future1a = identityLoader .load ("A" );
250252 CompletableFuture <String > future2a = identityLoader .load ("B" );
@@ -270,7 +272,8 @@ public void should_Clear_all_values_in_loader() throws ExecutionException, Inter
270272 assertThat (future2 .get (), equalTo ("B" ));
271273 assertThat (loadCalls , equalTo (singletonList (asList ("A" , "B" ))));
272274
273- identityLoader .clearAll ();
275+ DataLoader <String , String > dlFluent = identityLoader .clearAll ();
276+ assertThat (dlFluent , equalTo (identityLoader )); // fluency
274277
275278 CompletableFuture <String > future1a = identityLoader .load ("A" );
276279 CompletableFuture <String > future2a = identityLoader .load ("B" );
@@ -287,7 +290,8 @@ public void should_Allow_priming_the_cache() throws ExecutionException, Interrup
287290 List <Collection <String >> loadCalls = new ArrayList <>();
288291 DataLoader <String , String > identityLoader = idLoader (new DataLoaderOptions (), loadCalls );
289292
290- identityLoader .prime ("A" , "A" );
293+ DataLoader <String , String > dlFluency = identityLoader .prime ("A" , "A" );
294+ assertThat (dlFluency , equalTo (identityLoader ));
291295
292296 CompletableFuture <String > future1 = identityLoader .load ("A" );
293297 CompletableFuture <String > future2 = identityLoader .load ("B" );
0 commit comments