Skip to content

Commit 01012c1

Browse files
jyeminodrotbohm
authored andcommitted
DATAMONGO-895, DATAMONGO-896 - Assert compatibility with latest MongoDB Java driver.
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: spring-projects#159, spring-projects#160.
1 parent 4c7befb commit 01012c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<profile>
108108
<id>mongo-next</id>
109109
<properties>
110-
<mongo>2.12.0-rc0</mongo>
110+
<mongo>2.12.0</mongo>
111111
<mongo-osgi>2.12.0</mongo-osgi>
112112
</properties>
113113
</profile>

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public void findAndModifyShouldBumpVersionByOneWhenVersionFieldNotIncludedInUpda
235235
org.mockito.Matchers.isNull(DBObject.class), org.mockito.Matchers.isNull(DBObject.class), eq(false),
236236
captor.capture(), eq(false), eq(false));
237237

238-
Assert.assertThat(captor.getValue().get("$inc"), Is.<Object> is(new BasicDBObject("version", 1)));
238+
Assert.assertThat(captor.getValue().get("$inc"), Is.<Object> is(new BasicDBObject("version", 1L)));
239239
}
240240

241241
/**

0 commit comments

Comments
 (0)