@@ -61,16 +61,21 @@ void canChainTogetherOneInstrumentation() {
61
61
62
62
DataLoader <String , String > dl = DataLoaderFactory .newDataLoader (TestKit .keysAsValues (), options );
63
63
64
- dl .load ("A " );
65
- dl .load ("B " );
64
+ dl .load ("X " );
65
+ dl .load ("Y " );
66
66
67
67
CompletableFuture <List <String >> dispatch = dl .dispatch ();
68
68
69
69
await ().until (dispatch ::isDone );
70
70
71
- assertThat (capturingA .methods , equalTo (List .of ("A_beginDispatch" ,
71
+ assertThat (capturingA .notLoads () , equalTo (List .of ("A_beginDispatch" ,
72
72
"A_beginBatchLoader" , "A_beginBatchLoader_onDispatched" , "A_beginBatchLoader_onCompleted" ,
73
73
"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
+ )));
74
79
}
75
80
76
81
@@ -87,8 +92,8 @@ public void canChainTogetherManyInstrumentationsWithDifferentBatchLoaders(TestDa
87
92
88
93
DataLoader <String , String > dl = factory .idLoader (options );
89
94
90
- dl .load ("A " );
91
- dl .load ("B " );
95
+ dl .load ("X " );
96
+ dl .load ("Y " );
92
97
93
98
CompletableFuture <List <String >> dispatch = dl .dispatch ();
94
99
@@ -98,16 +103,21 @@ public void canChainTogetherManyInstrumentationsWithDifferentBatchLoaders(TestDa
98
103
// A_beginBatchLoader happens before A_beginDispatch_onDispatched because these are sync
99
104
// and no async - a batch scheduler or async batch loader would change that
100
105
//
101
- assertThat (capturingA .methods , equalTo (List .of ("A_beginDispatch" ,
106
+ assertThat (capturingA .notLoads () , equalTo (List .of ("A_beginDispatch" ,
102
107
"A_beginBatchLoader" , "A_beginBatchLoader_onDispatched" , "A_beginBatchLoader_onCompleted" ,
103
108
"A_beginDispatch_onDispatched" , "A_beginDispatch_onCompleted" )));
104
109
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" ,
106
116
"B_beginBatchLoader" , "B_beginBatchLoader_onDispatched" , "B_beginBatchLoader_onCompleted" ,
107
117
"B_beginDispatch_onDispatched" , "B_beginDispatch_onCompleted" )));
108
118
109
119
// 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" )));
111
121
}
112
122
113
123
@ Test
0 commit comments