Skip to content

Commit 8229374

Browse files
committed
Be more permissive on integral type of maxSize and storageSize for collStats command response
1 parent 74f6477 commit 8229374

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,15 @@ class CreateCollectionOperationSpecification extends OperationFunctionalSpecific
156156
collectionNameExists(getCollectionName())
157157

158158
when:
159-
def stats = new CommandWriteOperation<Document>(getDatabaseName(),
160-
new BsonDocument('collStats', new BsonString(getCollectionName())),
161-
new DocumentCodec()).execute(getBinding())
159+
def stats = new CommandWriteOperation<BsonDocument>(getDatabaseName(),
160+
new BsonDocument('collStats', new BsonString(getCollectionName())),
161+
new BsonDocumentCodec()).execute(getBinding())
162+
162163
then:
163-
stats.getBoolean('capped')
164-
stats.getInteger('max') == 100
164+
stats.getBoolean('capped').getValue()
165+
stats.getNumber('max').intValue() == 100
165166
// Starting in 3.0, the size in bytes moved from storageSize to maxSize
166-
stats.getInteger('maxSize') == 40 * 1024 || stats.getInteger('storageSize') == 40 * 1024
167+
stats.getNumber('maxSize').intValue() == 40 * 1024 || stats.getNumber('storageSize').intValue() == 40 * 1024
167168

168169
where:
169170
async << [true, false]

0 commit comments

Comments
 (0)