Skip to content

Commit a403807

Browse files
committed
DATAMONGO-1176 - Remove dropDups assertion.
The MongoDB 3 driver does no longer provide dropDups even if running agains a MongoDB v2.6.7.
1 parent f3d818a commit a403807

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -349,18 +349,12 @@ public void testEnsureIndex() throws Exception {
349349
assertThat(indexInfo.size(), is(2));
350350
Object indexKey = null;
351351
boolean unique = false;
352-
boolean dropDupes = false;
353352
for (org.bson.Document ix : indexInfo) {
354353

355354
if ("age_-1".equals(ix.get("name"))) {
356355
indexKey = ix.get("key");
357356
unique = (Boolean) ix.get("unique");
358-
if (mongoVersion.isLessThan(TWO_DOT_EIGHT)) {
359-
dropDupes = (Boolean) ix.get("dropDups");
360-
assertThat(dropDupes, is(true));
361-
} else {
362-
assertThat(ix.get("dropDups"), is(nullValue()));
363-
}
357+
assertThat(ix.get("dropDups"), is(nullValue()));
364358
}
365359
}
366360
assertThat(((org.bson.Document) indexKey), IsMapContaining.<String, Object> hasEntry("age", -1));
@@ -371,13 +365,7 @@ public void testEnsureIndex() throws Exception {
371365
assertThat(indexInfoList.size(), is(2));
372366
IndexInfo ii = indexInfoList.get(1);
373367
assertThat(ii.isUnique(), is(true));
374-
375-
if (mongoVersion.isLessThan(TWO_DOT_EIGHT)) {
376-
assertThat(ii.isDropDuplicates(), is(true));
377-
} else {
378-
assertThat(ii.isDropDuplicates(), is(false));
379-
}
380-
368+
assertThat(ii.isDropDuplicates(), is(false));
381369
assertThat(ii.isSparse(), is(false));
382370

383371
List<IndexField> indexFields = ii.getIndexFields();

0 commit comments

Comments
 (0)