@@ -61,16 +61,21 @@ void canChainTogetherOneInstrumentation() {
6161
6262 DataLoader <String , String > dl = DataLoaderFactory .newDataLoader (TestKit .keysAsValues (), options );
6363
64- dl .load ("A " );
65- dl .load ("B " );
64+ dl .load ("X " );
65+ dl .load ("Y " );
6666
6767 CompletableFuture <List <String >> dispatch = dl .dispatch ();
6868
6969 await ().until (dispatch ::isDone );
7070
71- assertThat (capturingA .methods , equalTo (List .of ("A_beginDispatch" ,
71+ assertThat (capturingA .notLoads () , equalTo (List .of ("A_beginDispatch" ,
7272 "A_beginBatchLoader" , "A_beginBatchLoader_onDispatched" , "A_beginBatchLoader_onCompleted" ,
7373 "A_beginDispatch_onDispatched" , "A_beginDispatch_onCompleted" )));
74+
75+ assertThat (capturingA .onlyLoads (), equalTo (List .of (
76+ "A_beginLoad_k:X" , "A_beginLoad_onDispatched_k:X" , "A_beginLoad_k:Y" , "A_beginLoad_onDispatched_k:Y" ,
77+ "A_beginLoad_onCompleted_k:X" , "A_beginLoad_onCompleted_k:Y"
78+ )));
7479 }
7580
7681
@@ -87,8 +92,8 @@ public void canChainTogetherManyInstrumentationsWithDifferentBatchLoaders(TestDa
8792
8893 DataLoader <String , String > dl = factory .idLoader (options );
8994
90- dl .load ("A " );
91- dl .load ("B " );
95+ dl .load ("X " );
96+ dl .load ("Y " );
9297
9398 CompletableFuture <List <String >> dispatch = dl .dispatch ();
9499
@@ -98,16 +103,21 @@ public void canChainTogetherManyInstrumentationsWithDifferentBatchLoaders(TestDa
98103 // A_beginBatchLoader happens before A_beginDispatch_onDispatched because these are sync
99104 // and no async - a batch scheduler or async batch loader would change that
100105 //
101- assertThat (capturingA .methods , equalTo (List .of ("A_beginDispatch" ,
106+ assertThat (capturingA .notLoads () , equalTo (List .of ("A_beginDispatch" ,
102107 "A_beginBatchLoader" , "A_beginBatchLoader_onDispatched" , "A_beginBatchLoader_onCompleted" ,
103108 "A_beginDispatch_onDispatched" , "A_beginDispatch_onCompleted" )));
104109
105- assertThat (capturingB .methods , equalTo (List .of ("B_beginDispatch" ,
110+ assertThat (capturingA .onlyLoads (), equalTo (List .of (
111+ "A_beginLoad_k:X" , "A_beginLoad_onDispatched_k:X" , "A_beginLoad_k:Y" , "A_beginLoad_onDispatched_k:Y" ,
112+ "A_beginLoad_onCompleted_k:X" , "A_beginLoad_onCompleted_k:Y"
113+ )));
114+
115+ assertThat (capturingB .notLoads (), equalTo (List .of ("B_beginDispatch" ,
106116 "B_beginBatchLoader" , "B_beginBatchLoader_onDispatched" , "B_beginBatchLoader_onCompleted" ,
107117 "B_beginDispatch_onDispatched" , "B_beginDispatch_onCompleted" )));
108118
109119 // it returned null on all its contexts - nothing to call back on
110- assertThat (capturingButReturnsNull .methods , equalTo (List .of ("NULL_beginDispatch" , "NULL_beginBatchLoader" )));
120+ assertThat (capturingButReturnsNull .notLoads () , equalTo (List .of ("NULL_beginDispatch" , "NULL_beginBatchLoader" )));
111121 }
112122
113123 @ Test
0 commit comments