DATAMONGO-1987 - Upgrade test infrastructure to MongoDB 4.0-rc0
Also make sure to use WriteConcern.MAJORITY when (re)creating collections in test setup.
This commit is contained in:
@@ -18,7 +18,7 @@ env:
|
||||
matrix:
|
||||
- PROFILE=ci
|
||||
global:
|
||||
- MONGO_VERSION=3.7.9
|
||||
- MONGO_VERSION=4.0.0-rc0
|
||||
|
||||
addons:
|
||||
apt:
|
||||
|
||||
@@ -44,7 +44,8 @@ public class MongoTestUtils {
|
||||
public static MongoCollection<Document> createOrReplaceCollection(String dbName, String collectionName,
|
||||
com.mongodb.MongoClient client) {
|
||||
|
||||
MongoDatabase database = client.getDatabase(dbName);
|
||||
MongoDatabase database = client.getDatabase(dbName).withWriteConcern(WriteConcern.MAJORITY)
|
||||
.withReadPreference(ReadPreference.primary());
|
||||
|
||||
boolean collectionExists = database.listCollections().filter(new Document("name", collectionName)).first() != null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user