3
3
import org .junit .Test ;
4
4
5
5
import java .util .ArrayList ;
6
- import java .util .Collections ;
7
6
import java .util .HashMap ;
8
7
import java .util .List ;
9
8
import java .util .Map ;
@@ -39,7 +38,7 @@ public void context_is_passed_to_batch_loader_function() throws Exception {
39
38
return CompletableFuture .completedFuture (list );
40
39
};
41
40
DataLoaderOptions options = DataLoaderOptions .newOptions ()
42
- .setBatchLoaderEnvironmentProvider (() -> "ctx" );
41
+ .setBatchLoaderContextProvider (() -> "ctx" );
43
42
DataLoader <String , String > loader = DataLoader .newDataLoader (batchLoader , options );
44
43
45
44
loader .load ("A" );
@@ -55,7 +54,7 @@ public void context_is_passed_to_batch_loader_function() throws Exception {
55
54
public void key_contexts_are_passed_to_batch_loader_function () throws Exception {
56
55
BatchLoaderWithContext <String , String > batchLoader = contextBatchLoader ();
57
56
DataLoaderOptions options = DataLoaderOptions .newOptions ()
58
- .setBatchLoaderEnvironmentProvider (() -> "ctx" );
57
+ .setBatchLoaderContextProvider (() -> "ctx" );
59
58
DataLoader <String , String > loader = DataLoader .newDataLoader (batchLoader , options );
60
59
61
60
loader .load ("A" , "aCtx" );
@@ -72,7 +71,7 @@ public void key_contexts_are_passed_to_batch_loader_function_when_batching_disab
72
71
BatchLoaderWithContext <String , String > batchLoader = contextBatchLoader ();
73
72
DataLoaderOptions options = DataLoaderOptions .newOptions ()
74
73
.setBatchingEnabled (false )
75
- .setBatchLoaderEnvironmentProvider (() -> "ctx" );
74
+ .setBatchLoaderContextProvider (() -> "ctx" );
76
75
DataLoader <String , String > loader = DataLoader .newDataLoader (batchLoader , options );
77
76
78
77
CompletableFuture <String > aLoad = loader .load ("A" , "aCtx" );
@@ -89,7 +88,7 @@ public void key_contexts_are_passed_to_batch_loader_function_when_batching_disab
89
88
public void missing_key_contexts_are_passed_to_batch_loader_function () throws Exception {
90
89
BatchLoaderWithContext <String , String > batchLoader = contextBatchLoader ();
91
90
DataLoaderOptions options = DataLoaderOptions .newOptions ()
92
- .setBatchLoaderEnvironmentProvider (() -> "ctx" );
91
+ .setBatchLoaderContextProvider (() -> "ctx" );
93
92
DataLoader <String , String > loader = DataLoader .newDataLoader (batchLoader , options );
94
93
95
94
loader .load ("A" , "aCtx" );
@@ -113,7 +112,7 @@ public void context_is_passed_to_map_batch_loader_function() throws Exception {
113
112
return CompletableFuture .completedFuture (map );
114
113
};
115
114
DataLoaderOptions options = DataLoaderOptions .newOptions ()
116
- .setBatchLoaderEnvironmentProvider (() -> "ctx" );
115
+ .setBatchLoaderContextProvider (() -> "ctx" );
117
116
DataLoader <String , String > loader = DataLoader .newMappedDataLoader (mapBatchLoader , options );
118
117
119
118
loader .load ("A" , "aCtx" );
0 commit comments