Browse Source

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: #159, #160.
pull/136/merge
Jeff Yemin 12 years ago committed by Oliver Gierke
parent
commit
01012c1448
  1. 2
      pom.xml
  2. 2
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateUnitTests.java

2
pom.xml

@ -107,7 +107,7 @@ @@ -107,7 +107,7 @@
<profile>
<id>mongo-next</id>
<properties>
<mongo>2.12.0-rc0</mongo>
<mongo>2.12.0</mongo>
<mongo-osgi>2.12.0</mongo-osgi>
</properties>
</profile>

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

@ -235,7 +235,7 @@ public class MongoTemplateUnitTests extends MongoOperationsUnitTests { @@ -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.<Object> is(new BasicDBObject("version", 1)));
Assert.assertThat(captor.getValue().get("$inc"), Is.<Object> is(new BasicDBObject("version", 1L)));
}
/**

Loading…
Cancel
Save