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.

Original pull request: #764.
This commit is contained in:
Christoph Strobl
2019-06-19 08:36:19 +02:00
committed by Mark Paluch
parent 8ce8a8307a
commit 5e452e1be0
2 changed files with 7 additions and 5 deletions

View File

@@ -27,7 +27,7 @@
<project.type>multi</project.type>
<dist.id>spring-data-mongodb</dist.id>
<springdata.commons>2.2.0.BUILD-SNAPSHOT</springdata.commons>
<mongo>3.11.0-beta3</mongo>
<mongo>3.11.0-beta4</mongo>
<mongo.reactivestreams>1.11.0</mongo.reactivestreams>
<jmh.version>1.19</jmh.version>
</properties>

View File

@@ -22,6 +22,7 @@ import lombok.Data;
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.Index;
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 class ReactiveMongoTemplateIndexTests {
.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();