@@ -692,13 +692,13 @@ public void should_work_with_duplicate_keys_when_caching_enabled() throws Execut
692692 public void should_Accept_objects_with_a_complex_key () throws ExecutionException , InterruptedException {
693693 List <Collection <JsonObject >> loadCalls = new ArrayList <>();
694694 DataLoaderOptions options = newOptions ().setCacheKeyFunction (getJsonObjectCacheMapFn ());
695- DataLoader <JsonObject , Integer > identityLoader = idLoader (options , loadCalls );
695+ DataLoader <JsonObject , JsonObject > identityLoader = idLoader (options , loadCalls );
696696
697697 JsonObject key1 = new JsonObject ().put ("id" , 123 );
698698 JsonObject key2 = new JsonObject ().put ("id" , 123 );
699699
700- CompletableFuture <Integer > future1 = identityLoader .load (key1 );
701- CompletableFuture <Integer > future2 = identityLoader .load (key2 );
700+ CompletableFuture <JsonObject > future1 = identityLoader .load (key1 );
701+ CompletableFuture <JsonObject > future2 = identityLoader .load (key2 );
702702 identityLoader .dispatch ();
703703
704704 await ().until (() -> future1 .isDone () && future2 .isDone ());
@@ -713,18 +713,18 @@ public void should_Accept_objects_with_a_complex_key() throws ExecutionException
713713 public void should_Clear_objects_with_complex_key () throws ExecutionException , InterruptedException {
714714 List <Collection <JsonObject >> loadCalls = new ArrayList <>();
715715 DataLoaderOptions options = newOptions ().setCacheKeyFunction (getJsonObjectCacheMapFn ());
716- DataLoader <JsonObject , Integer > identityLoader = idLoader (options , loadCalls );
716+ DataLoader <JsonObject , JsonObject > identityLoader = idLoader (options , loadCalls );
717717
718718 JsonObject key1 = new JsonObject ().put ("id" , 123 );
719719 JsonObject key2 = new JsonObject ().put ("id" , 123 );
720720
721- CompletableFuture <Integer > future1 = identityLoader .load (key1 );
721+ CompletableFuture <JsonObject > future1 = identityLoader .load (key1 );
722722 identityLoader .dispatch ();
723723
724724 await ().until (future1 ::isDone );
725725 identityLoader .clear (key2 ); // clear equivalent object key
726726
727- CompletableFuture <Integer > future2 = identityLoader .load (key1 );
727+ CompletableFuture <JsonObject > future2 = identityLoader .load (key1 );
728728 identityLoader .dispatch ();
729729
730730 await ().until (future2 ::isDone );
@@ -737,22 +737,22 @@ public void should_Clear_objects_with_complex_key() throws ExecutionException, I
737737 public void should_Accept_objects_with_different_order_of_keys () throws ExecutionException , InterruptedException {
738738 List <Collection <JsonObject >> loadCalls = new ArrayList <>();
739739 DataLoaderOptions options = newOptions ().setCacheKeyFunction (getJsonObjectCacheMapFn ());
740- DataLoader <JsonObject , Integer > identityLoader = idLoader (options , loadCalls );
740+ DataLoader <JsonObject , JsonObject > identityLoader = idLoader (options , loadCalls );
741741
742742 JsonObject key1 = new JsonObject ().put ("a" , 123 ).put ("b" , 321 );
743743 JsonObject key2 = new JsonObject ().put ("b" , 321 ).put ("a" , 123 );
744744
745745 // Fetches as expected
746746
747- CompletableFuture <Integer > future1 = identityLoader .load (key1 );
748- CompletableFuture <Integer > future2 = identityLoader .load (key2 );
747+ CompletableFuture <JsonObject > future1 = identityLoader .load (key1 );
748+ CompletableFuture <JsonObject > future2 = identityLoader .load (key2 );
749749 identityLoader .dispatch ();
750750
751751 await ().until (() -> future1 .isDone () && future2 .isDone ());
752752 assertThat (loadCalls , equalTo (singletonList (singletonList (key1 ))));
753753 assertThat (loadCalls .size (), equalTo (1 ));
754754 assertThat (future1 .get (), equalTo (key1 ));
755- assertThat (future2 .get (), equalTo (key1 ));
755+ assertThat (future2 .get (), equalTo (key2 ));
756756 }
757757
758758 @ Test
0 commit comments