Skip to content

Commit 8563778

Browse files
committed
Convert legacy retryable reads tests to unified format
* Use "mapReduce" instead of "mapreduce" for the command name, as documented, and as expected by the tests. JAVA-5344
1 parent 03746fa commit 8563778

File tree

98 files changed

+24825
-18841
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+24825
-18841
lines changed

driver-core/src/main/com/mongodb/internal/operation/MapReduceToCollectionOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private BsonDocument getCommand(@Nullable final ConnectionDescription descriptio
300300
if (getDatabaseName() != null) {
301301
outputDocument.put("db", new BsonString(getDatabaseName()));
302302
}
303-
BsonDocument commandDocument = new BsonDocument("mapreduce", new BsonString(namespace.getCollectionName()))
303+
BsonDocument commandDocument = new BsonDocument("mapReduce", new BsonString(namespace.getCollectionName()))
304304
.append("map", getMapFunction())
305305
.append("reduce", getReduceFunction())
306306
.append("out", outputDocument);

driver-core/src/main/com/mongodb/internal/operation/MapReduceWithInlineResultsOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private CommandCreator getCommandCreator(final SessionContext sessionContext) {
231231
}
232232

233233
private BsonDocument getCommand(final SessionContext sessionContext, final int maxWireVersion) {
234-
BsonDocument commandDocument = new BsonDocument("mapreduce", new BsonString(namespace.getCollectionName()))
234+
BsonDocument commandDocument = new BsonDocument("mapReduce", new BsonString(namespace.getCollectionName()))
235235
.append("map", getMapFunction())
236236
.append("reduce", getReduceFunction())
237237
.append("out", new BsonDocument("inline", new BsonInt32(1)));

driver-core/src/test/functional/com/mongodb/internal/operation/MapReduceToCollectionOperationSpecification.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class MapReduceToCollectionOperationSpecification extends OperationFunctionalSpe
247247

248248
when:
249249
def operation = new MapReduceToCollectionOperation(getNamespace(), mapF, reduceF, out, WriteConcern.MAJORITY)
250-
def expectedCommand = new BsonDocument('mapreduce', new BsonString(getCollectionName()))
250+
def expectedCommand = new BsonDocument('mapReduce', new BsonString(getCollectionName()))
251251
.append('map', mapF)
252252
.append('reduce', reduceF)
253253
.append('out', BsonDocument.parse('{replace: "outCollection"}'))

driver-core/src/test/functional/com/mongodb/internal/operation/MapReduceWithInlineResultsOperationSpecification.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction
155155
when:
156156
def operation = new MapReduceWithInlineResultsOperation<Document>(helper.namespace, new BsonJavaScript('function(){ }'),
157157
new BsonJavaScript('function(key, values){ }'), bsonDocumentCodec)
158-
def expectedCommand = new BsonDocument('mapreduce', new BsonString(helper.namespace.getCollectionName()))
158+
def expectedCommand = new BsonDocument('mapReduce', new BsonString(helper.namespace.getCollectionName()))
159159
.append('map', operation.getMapFunction())
160160
.append('reduce', operation.getReduceFunction())
161161
.append('out', new BsonDocument('inline', new BsonInt32(1)))
@@ -235,7 +235,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction
235235
source.retain() >> source
236236
source.getServerApi() >> null
237237
def commandDocument = BsonDocument.parse('''
238-
{ "mapreduce" : "coll",
238+
{ "mapReduce" : "coll",
239239
"map" : { "$code" : "function(){ }" },
240240
"reduce" : { "$code" : "function(key, values){ }" },
241241
"out" : { "inline" : 1 },
@@ -284,7 +284,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction
284284
source.getConnection(_) >> { it[0].onResult(connection, null) }
285285
source.retain() >> source
286286
def commandDocument = BsonDocument.parse('''
287-
{ "mapreduce" : "coll",
287+
{ "mapReduce" : "coll",
288288
"map" : { "$code" : "function(){ }" },
289289
"reduce" : { "$code" : "function(key, values){ }" },
290290
"out" : { "inline" : 1 },

driver-core/src/test/resources/retryable-reads/README.rst

Lines changed: 0 additions & 178 deletions
This file was deleted.

driver-core/src/test/resources/retryable-reads/aggregate-merge.json

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)