From f774a607ef4585d4a468c78c0a12fa00ab8c4ebc Mon Sep 17 00:00:00 2001 From: Thomas Risberg Date: Wed, 6 Apr 2011 12:48:06 -0400 Subject: [PATCH] fixed added additional test without generated id for testPersonWithCustomIdName --- .../data/document/mongodb/mapping/MappingTests.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/document/mongodb/mapping/MappingTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/document/mongodb/mapping/MappingTests.java index e224aa5d4..6529d3d94 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/document/mongodb/mapping/MappingTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/document/mongodb/mapping/MappingTests.java @@ -99,21 +99,20 @@ public class MappingTests { // POJOs aren't auto-detected, have to add manually mappingContext.addPersistentEntity(PersonCustomIdName.class); - PersonCustomIdName p = new PersonCustomIdName(123456, "Custom Id", "LastName"); + PersonCustomIdName p = new PersonCustomIdName(123456, "Custom Id", null); template.insert(p); List result = template.find(new Query(Criteria.where("ssn").is(123456)), PersonCustomIdName.class); assertThat(result.size(), is(1)); assertNotNull(result.get(0).getLastName()); - PersonCustomIdName p2 = new PersonCustomIdName(654321, "Custom Id"); - p2.setLastName("Smith"); + PersonCustomIdName p2 = new PersonCustomIdName(654321, "Custom Id", "LastName"); template.insert(p2); List result2 = template.find(new Query(Criteria.where("ssn").is(654321)), PersonCustomIdName.class); assertThat(result2.size(), is(1)); assertNotNull(result2.get(0).getLastName()); - assertThat(result2.get(0).getLastName(), is("Smith")); + assertThat(result2.get(0).getLastName(), is("LastName")); }