use of org.springframework.data.mongodb.core.convert.MappingMongoConverterUnitTests.Person in project spring-data-mongodb by spring-projects.
the class DbRefMappingMongoConverterUnitTests method createsDBRefWithClientSpecCorrectly.
// DATAMONGO-347
@Test
public void createsDBRefWithClientSpecCorrectly() {
PropertyPath path = PropertyPath.from("person", PersonClient.class);
MongoPersistentProperty property = mappingContext.getPersistentPropertyPath(path).getLeafProperty();
Person person = new Person();
person.id = "foo";
DBRef dbRef = converter.toDBRef(person, property);
assertThat(dbRef.getId(), is("foo"));
assertThat(dbRef.getCollectionName(), is("person"));
}
use of org.springframework.data.mongodb.core.convert.MappingMongoConverterUnitTests.Person in project spring-data-mongodb by spring-projects.
the class DbRefMappingMongoConverterUnitTests method createsSimpleDBRefCorrectly.
// DATAMONGO-347
@Test
public void createsSimpleDBRefCorrectly() {
Person person = new Person();
person.id = "foo";
DBRef dbRef = converter.toDBRef(person, null);
assertThat(dbRef.getId(), is("foo"));
assertThat(dbRef.getCollectionName(), is("person"));
}
Aggregations