Skip to content

Commit 177a438

Browse files
DATAMONGO-1987 - Upgrade test infrastructure to MongoDB 4.0-rc0
1 parent 6a64606 commit 177a438

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ env:
1818
matrix:
1919
- PROFILE=ci
2020
global:
21-
- MONGO_VERSION=3.7.9
21+
- MONGO_VERSION=4.0.0-rc0
2222

2323
addons:
2424
apt:

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/MongoTestUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ public class MongoTestUtils {
4444
public static MongoCollection<Document> createOrReplaceCollection(String dbName, String collectionName,
4545
com.mongodb.MongoClient client) {
4646

47-
MongoDatabase database = client.getDatabase(dbName);
47+
MongoDatabase database = client.getDatabase(dbName).withWriteConcern(WriteConcern.MAJORITY)
48+
.withReadPreference(ReadPreference.primary());
4849

4950
boolean collectionExists = database.listCollections().filter(new Document("name", collectionName)).first() != null;
5051

0 commit comments

Comments
 (0)