From 01012c14489fcc8d2b2522145b391b852bf8e560 Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Fri, 28 Mar 2014 13:41:45 -0400 Subject: [PATCH] DATAMONGO-895, DATAMONGO-896 - Assert compatibility with latest MongoDB Java driver. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Upgrade next MongoDB driver version to 2.12.0. Strong upgrade coming in a subsequent commit to make sure we can backport the compatibility checks to the bugfix branch without forcing users into a driver upgrade. Relaxing error message comparison in assertion so that it still matches against the message returned by MongoDB 2.6. When comparing the value of the version field, compare against a Long rather than an Integer, since the version field generated is a Long. This allows the test to pass against the upcoming 2.12.0 release of the Java driver, which has a stricter implementation of BasisDBObject.equals(…). Original pull requests: #159, #160. --- pom.xml | 2 +- .../data/mongodb/core/MongoTemplateUnitTests.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 28e7260e2..7c215d6c6 100644 --- a/pom.xml +++ b/pom.xml @@ -107,7 +107,7 @@ mongo-next - 2.12.0-rc0 + 2.12.0 2.12.0 diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java index 2d04c285b..f1024adc0 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java @@ -235,7 +235,7 @@ public class MongoTemplateUnitTests extends MongoOperationsUnitTests { org.mockito.Matchers.isNull(DBObject.class), org.mockito.Matchers.isNull(DBObject.class), eq(false), captor.capture(), eq(false), eq(false)); - Assert.assertThat(captor.getValue().get("$inc"), Is. is(new BasicDBObject("version", 1))); + Assert.assertThat(captor.getValue().get("$inc"), Is. is(new BasicDBObject("version", 1L))); } /**