public class EntityMapperTests extends EntityTestBase {
@Test
@Transactional
public void entityMapperShouldForwardEntityPath() throws Exception {
Person michael = persist(new Person("Michael", 36));
EntityMapper<Person, Person, String> mapper = new EntityMapper<Person, Person, String>(neo4jTemplate) {
@Override
public String mapPath(EntityPath<Person, Person> entityPath) {
return entityPath.<Person>startEntity().getName();
}
};
String name = mapper.mapPath(new NodePath(getNodeState(michael)));
Assert.assertEquals(michael.getName(), name);
}