@@ -44,6 +44,7 @@ import org.bson.Document
4444import org.bson.codecs.Decoder
4545import org.bson.codecs.DocumentCodec
4646
47+ import static com.mongodb.ClusterFixture.createOperationContext
4748import static com.mongodb.ClusterFixture.executeAsync
4849import static com.mongodb.ClusterFixture.getBinding
4950import static org.junit.jupiter.api.Assertions.assertEquals
@@ -59,7 +60,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
5960
6061 def binding = getBinding()
6162 when :
62- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
63+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
6364
6465 then :
6566 ! cursor. hasNext()
@@ -97,7 +98,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
9798
9899 def binding = getBinding()
99100 when :
100- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
101+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
101102 def collections = cursor. next()
102103 def names = collections* . get(' name' )
103104
@@ -120,7 +121,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
120121
121122 def binding = getBinding()
122123 when :
123- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference())
124+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference())
124125 )
125126 def collections = cursor. next()
126127 def names = collections* . get(' name' )
@@ -142,7 +143,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
142143
143144 def binding = getBinding()
144145 when :
145- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
146+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
146147 def collections = cursor. next()
147148 def names = collections* . get(' name' )
148149
@@ -160,7 +161,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
160161
161162 def binding = getBinding()
162163 when :
163- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
164+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
164165 def collection = cursor. next()[0 ]
165166
166167 then :
@@ -177,7 +178,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
177178
178179 def binding = getBinding()
179180 when :
180- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
181+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
181182 def collection = cursor. next()[0 ]
182183
183184 then :
@@ -194,7 +195,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
194195
195196 def binding = getBinding()
196197 when :
197- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
198+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
198199 def collection = cursor. next()[0 ]
199200
200201 then :
@@ -226,14 +227,14 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
226227 def binding = getBinding()
227228 given :
228229 new DropDatabaseOperation (databaseName, WriteConcern . ACKNOWLEDGED )
229- .execute(binding, getOperationContext (binding. getReadPreference()))
230+ .execute(binding, createOperationContext (binding. getReadPreference()))
230231 addSeveralIndexes()
231232 def operation = new ListCollectionsOperation (databaseName, new DocumentCodec ()). batchSize(2 )
232233
233234
234235 when :
235236 binding = getBinding()
236- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
237+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
237238
238239 then :
239240 cursor. hasNext()
@@ -246,13 +247,13 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
246247 def binding = getBinding()
247248 given :
248249 new DropDatabaseOperation (databaseName, WriteConcern . ACKNOWLEDGED )
249- .execute(binding, getOperationContext (binding. getReadPreference()))
250+ .execute(binding, createOperationContext (binding. getReadPreference()))
250251 addSeveralIndexes()
251252 def operation = new ListCollectionsOperation (databaseName, new DocumentCodec ()). batchSize(2 )
252253
253254 when :
254255 binding = getBinding()
255- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
256+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
256257 def list = cursorToListWithNext(cursor)
257258
258259 then :
@@ -271,14 +272,14 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
271272 def binding = getBinding()
272273 given :
273274 new DropDatabaseOperation (databaseName, WriteConcern . ACKNOWLEDGED )
274- .execute(binding, getOperationContext (binding. getReadPreference()))
275+ .execute(binding, createOperationContext (binding. getReadPreference()))
275276 addSeveralIndexes()
276277 def operation = new ListCollectionsOperation (databaseName, new DocumentCodec ()). batchSize(2 )
277278
278279
279280 when :
280281 binding = getBinding()
281- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
282+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
282283
283284 then :
284285 cursor. hasNext()
@@ -297,13 +298,13 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
297298 given :
298299 def binding = getBinding()
299300 new DropDatabaseOperation (databaseName, WriteConcern . ACKNOWLEDGED )
300- .execute(binding, getOperationContext (binding. getReadPreference()))
301+ .execute(binding, createOperationContext (binding. getReadPreference()))
301302 addSeveralIndexes()
302303 def operation = new ListCollectionsOperation (databaseName, new DocumentCodec ()). batchSize(2 )
303304
304305 when :
305306 binding = getBinding()
306- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
307+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
307308 def list = cursorToListWithTryNext(cursor)
308309
309310 then :
@@ -317,7 +318,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
317318 given :
318319 def binding = getBinding()
319320 new DropDatabaseOperation (databaseName, WriteConcern . ACKNOWLEDGED )
320- .execute(binding, getOperationContext (binding. getReadPreference()))
321+ .execute(binding, createOperationContext (binding. getReadPreference()))
321322 addSeveralIndexes()
322323 def operation = new ListCollectionsOperation (databaseName, new DocumentCodec ()). batchSize(2 )
323324
@@ -343,7 +344,7 @@ class ListCollectionsOperationSpecification extends OperationFunctionalSpecifica
343344
344345 when :
345346 def binding = getBinding()
346- def cursor = operation. execute(binding, getOperationContext (binding. getReadPreference()))
347+ def cursor = operation. execute(binding, createOperationContext (binding. getReadPreference()))
347348 def collections = cursor. next()
348349
349350 then :
0 commit comments