Upgrade to MongoDB driver 4.0 (Snapshot)

This commit is contained in:
Christoph Strobl
2019-12-06 10:16:33 +01:00
parent ff9c9663f7
commit b014e718de
2 changed files with 14 additions and 19 deletions

27
pom.xml
View File

@@ -75,8 +75,8 @@
<jsr305.version>3.0.2</jsr305.version>
<junit-bom.version>5.5.1</junit-bom.version>
<mockito.version>2.28.2</mockito.version>
<mongo.version>3.11.0</mongo.version>
<mongo-reactivestreams.version>1.12.0</mongo-reactivestreams.version>
<mongo.version>4.0.0-SNAPSHOT</mongo.version>
<mongo-reactivestreams.version>${mongo.version}</mongo-reactivestreams.version>
<reactor-bom.version>Dysprosium-RELEASE</reactor-bom.version>
<spring-bom.version>5.2.0.RELEASE</spring-bom.version>
<spring-data-bom.version>Moore-RELEASE</spring-data-bom.version>
@@ -497,11 +497,17 @@
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<artifactId>mongodb-driver-sync</artifactId>
<version>${mongo.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-reactivestreams</artifactId>
<version>${mongo-reactivestreams.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
@@ -648,19 +654,6 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-reactivestreams</artifactId>
<version>${mongo-reactivestreams.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-async</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>

View File

@@ -42,7 +42,9 @@ import org.springframework.session.data.mongo.MongoIndexedSessionRepository;
import org.springframework.session.data.mongo.MongoSession;
import org.springframework.util.SocketUtils;
import com.mongodb.MongoClient;
import com.mongodb.ConnectionString;
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
/**
* Abstract base class for {@link MongoIndexedSessionRepository} tests.
@@ -401,7 +403,7 @@ abstract public class AbstractMongoRepositoryITest extends AbstractITest {
@DependsOn("embeddedMongoServer")
public MongoOperations mongoOperations() throws UnknownHostException {
MongoClient mongo = new MongoClient("localhost", this.embeddedMongoPort);
MongoClient mongo = MongoClients.create(new ConnectionString("mongodb://localhost:" + this.embeddedMongoPort));
return new MongoTemplate(mongo, "test");
}