From ffc70f2d5a129ca83b87966ef8b0dc1431cb33b3 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Wed, 19 Jun 2019 08:31:43 +0200 Subject: [PATCH 1/2] DATAMONGO-2305 - Prepare issue branch. --- pom.xml | 2 +- spring-data-mongodb-benchmarks/pom.xml | 2 +- spring-data-mongodb-distribution/pom.xml | 2 +- spring-data-mongodb/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 340e6922b4..389b997e83 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-mongodb-parent - 2.2.0.BUILD-SNAPSHOT + 2.2.0.DATAMONGO-2305-SNAPSHOT pom Spring Data MongoDB diff --git a/spring-data-mongodb-benchmarks/pom.xml b/spring-data-mongodb-benchmarks/pom.xml index bb7d9f03cc..a92ad0178e 100644 --- a/spring-data-mongodb-benchmarks/pom.xml +++ b/spring-data-mongodb-benchmarks/pom.xml @@ -7,7 +7,7 @@ org.springframework.data spring-data-mongodb-parent - 2.2.0.BUILD-SNAPSHOT + 2.2.0.DATAMONGO-2305-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb-distribution/pom.xml b/spring-data-mongodb-distribution/pom.xml index b32dcba387..0f2c32a2f5 100644 --- a/spring-data-mongodb-distribution/pom.xml +++ b/spring-data-mongodb-distribution/pom.xml @@ -14,7 +14,7 @@ org.springframework.data spring-data-mongodb-parent - 2.2.0.BUILD-SNAPSHOT + 2.2.0.DATAMONGO-2305-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index b611cf01a8..33a9185317 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -11,7 +11,7 @@ org.springframework.data spring-data-mongodb-parent - 2.2.0.BUILD-SNAPSHOT + 2.2.0.DATAMONGO-2305-SNAPSHOT ../pom.xml From 9d39b4a550a824f93890076ff2d8a88310a130f0 Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Wed, 19 Jun 2019 08:36:19 +0200 Subject: [PATCH 2/2] DATAMONGO-2305 - Upgrade to MongoDB Java Driver 3.11.0-beta4. Tested against 4.0.9 and 4.2.0-rc1 servers. Added a delay and left a todo in one of the tests where the 4.2.0-rc1 server takes a bit longer than it predecessor when creating indexes which can lead to BackgroundOperationInProgressForNamespace errors. --- pom.xml | 2 +- .../mongodb/core/ReactiveMongoTemplateIndexTests.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 389b997e83..e0d474ee95 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ multi spring-data-mongodb 2.2.0.BUILD-SNAPSHOT - 3.11.0-beta3 + 3.11.0-beta4 1.11.0 1.19 diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateIndexTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateIndexTests.java index e7cebb1081..1e62a697da 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateIndexTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/ReactiveMongoTemplateIndexTests.java @@ -22,6 +22,7 @@ import reactor.core.publisher.Flux; import reactor.test.StepVerifier; +import java.time.Duration; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; @@ -41,13 +42,13 @@ import org.springframework.data.mongodb.core.index.IndexField; import org.springframework.data.mongodb.core.index.IndexInfo; import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.test.util.MongoTestUtils; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import com.mongodb.client.model.IndexOptions; import com.mongodb.reactivestreams.client.ListIndexesPublisher; import com.mongodb.reactivestreams.client.MongoClient; -import com.mongodb.reactivestreams.client.Success; /** * Integration test for index creation via {@link ReactiveMongoTemplate}. @@ -68,9 +69,9 @@ public class ReactiveMongoTemplateIndexTests { @Before public void setUp() { - StepVerifier.create(template.getCollection("person").drop()).expectNext(Success.SUCCESS).verifyComplete(); - StepVerifier.create(template.getCollection("indexfail").drop()).expectNext(Success.SUCCESS).verifyComplete(); - StepVerifier.create(template.getCollection("indexedSample").drop()).expectNext(Success.SUCCESS).verifyComplete(); + MongoTestUtils.dropCollectionNow(template.getMongoDatabase().getName(), "person", client); + MongoTestUtils.dropCollectionNow(template.getMongoDatabase().getName(), "indexfail", client); + MongoTestUtils.dropCollectionNow(template.getMongoDatabase().getName(), "indexedSample", client); } @After @@ -199,6 +200,7 @@ public void shouldCreateIndexOnAccess() { .verifyComplete(); template.findAll(IndexedSample.class) // + .delayElements(Duration.ofMillis(200)) // TODO: check if 4.2.0 server GA still requires this timeout .as(StepVerifier::create) // .verifyComplete();