Skip to content

Commit 37030ae

Browse files
committed
ChangeStreams update tests for latest nightly
1 parent c5dbee1 commit 37030ae

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ class AggregateOperationSpecification extends OperationFunctionalSpecification {
178178
given:
179179
def expected = [createExpectedChangeNotification(namespace, 0), createExpectedChangeNotification(namespace, 1)]
180180

181-
def pipeline = ['{$changeStream: {}}', '{$project: {"_id.clusterTime": 0}}'].collect { BsonDocument.parse(it) }
181+
def pipeline = ['{$changeStream: {}}', '{$project: {"_id.clusterTime": 0, "_id.uuid": 0}}'].collect { BsonDocument.parse(it) }
182182
def operation = new AggregateOperation<BsonDocument>(namespace, pipeline, new BsonDocumentCodec())
183183

184184
when:
@@ -194,7 +194,7 @@ class AggregateOperationSpecification extends OperationFunctionalSpecification {
194194
cursor?.close()
195195

196196
where:
197-
async << [true]
197+
async << [true, false]
198198
}
199199

200200
def 'should be able to aggregate'() {
@@ -406,7 +406,6 @@ class AggregateOperationSpecification extends OperationFunctionalSpecification {
406406
private static BsonDocument createExpectedChangeNotification(MongoNamespace namespace, int idValue) {
407407
BsonDocument.parse("""{
408408
"_id": {
409-
"ns": "$namespace",
410409
"documentKey": {"_id": $idValue}
411410
},
412411
"operationType": "insert",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio
287287
docs.collect {
288288
BsonDocument.parse("""{
289289
"_id": {
290-
"ns": "${helper.getNamespace()}",
291290
"documentKey": {"_id": $it}
292291
},
293292
"operationType": "insert",
@@ -299,16 +298,17 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio
299298
}
300299

301300
def tryNextAndClean(cursor, boolean async) {
302-
removeTimestamp(tryNext(cursor, async))
301+
removeTimestampAndUUID(tryNext(cursor, async))
303302
}
304303

305304
def nextAndClean(cursor, boolean async) {
306-
removeTimestamp(next(cursor, async))
305+
removeTimestampAndUUID(next(cursor, async))
307306
}
308307

309-
def removeTimestamp(List<BsonDocument> next) {
308+
def removeTimestampAndUUID(List<BsonDocument> next) {
310309
next?.collect { doc ->
311310
doc.getDocument('_id').remove('clusterTime')
311+
doc.getDocument('_id').remove('uuid')
312312
doc
313313
}
314314
}

0 commit comments

Comments
 (0)