Browse Source

DATAMONGO-799 - Fix failing test in MongoTemplateTests on MongoDB 2.5.x.

Generalized exception message matching to reflect the changed exception message in MongoDB 2.5.x that also works with previous versions of MongoDB.

Original pull request: #97.
pull/101/merge
Thomas Darimont 12 years ago committed by Oliver Gierke
parent
commit
9ea9912b23
  1. 5
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/MongoTemplateTests.java

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

@ -216,6 +216,7 @@ public class MongoTemplateTests { @@ -216,6 +216,7 @@ public class MongoTemplateTests {
/**
* @see DATAMONGO-480
* @see DATAMONGO-799
*/
@Test
public void throwsExceptionForUpdateWithInvalidPushOperator() {
@ -231,8 +232,10 @@ public class MongoTemplateTests { @@ -231,8 +232,10 @@ public class MongoTemplateTests {
thrown.expect(DataIntegrityViolationException.class);
thrown.expectMessage("Execution");
thrown.expectMessage("$push");
thrown.expectMessage("UPDATE");
thrown.expectMessage("array");
thrown.expectMessage("firstName");
thrown.expectMessage("failed");
Query query = new Query(Criteria.where("firstName").is("Amol"));
Update upd = new Update().push("age", 29);

Loading…
Cancel
Save