Skip to content

Commit 672024a

Browse files
committed
Test: Fixed DBCursorTest for latest MongoDB version
1 parent befbea5 commit 672024a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

driver/src/test/functional/com/mongodb/DBCursorTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import static com.mongodb.ClusterFixture.enableMaxTimeFailPoint;
3131
import static com.mongodb.ClusterFixture.isSharded;
3232
import static com.mongodb.ClusterFixture.serverVersionAtLeast;
33+
import static java.util.Arrays.asList;
3334
import static org.hamcrest.CoreMatchers.not;
3435
import static org.hamcrest.core.Is.is;
3536
import static org.junit.Assert.assertEquals;
@@ -417,7 +418,9 @@ public void testSettingACommentInsertsCommentIntoProfileCollectionWhenProfilingI
417418
assertEquals(1, profileCollection.count());
418419

419420
DBObject profileDocument = profileCollection.findOne();
420-
if (serverVersionAtLeast(3, 2)) {
421+
if (serverVersionAtLeast(asList(3, 5, 8))) {
422+
assertEquals(expectedComment, ((DBObject) profileDocument.get("command")).get("comment"));
423+
} else if (serverVersionAtLeast(3, 2)) {
421424
assertEquals(expectedComment, ((DBObject) profileDocument.get("query")).get("comment"));
422425
} else {
423426
assertEquals(expectedComment, ((DBObject) profileDocument.get("query")).get("$comment"));

0 commit comments

Comments
 (0)