Skip to content

Commit 37f5041

Browse files
committed
Fix QueryProctocolCommandEventSpecification so that it works with MongoDB 3.2, which sometimes returns a cursor even when none is required.
1 parent 36f8311 commit 37f5041

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

driver-core/src/test/functional/com/mongodb/connection/QueryProtocolCommandEventSpecification.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,11 @@ class QueryProtocolCommandEventSpecification extends OperationFunctionalSpecific
177177
protocol.commandListener = commandListener
178178

179179
when:
180-
protocol.execute(connection)
180+
def queryResult = protocol.execute(connection)
181181

182182
then:
183183
def response = new BsonDocument('cursor',
184-
new BsonDocument('id', new BsonInt64(0))
184+
new BsonDocument('id', new BsonInt64(queryResult.cursor ? queryResult.cursor.id : 0L))
185185
.append('ns', new BsonString(getNamespace().getFullName()))
186186
.append('firstBatch', new BsonArray()))
187187
.append('ok', new BsonDouble(1.0))

0 commit comments

Comments
 (0)