}
@Test
@Transactional
public void testSingleRelatedToViaField() {
Group group = persist(new Group());
Person mentor = persist(new Person());
group.setMentorship(new Mentorship(mentor,group));
persist(group);
final Node node = neo4jTemplate.getPersistentState(group);
assertEquals(1,IteratorUtil.count(node.getRelationships(Direction.INCOMING,DynamicRelationshipType.withName("mentors"))));
final Group loaded = neo4jTemplate.load(node, Group.class);
assertEquals(group.getMentorship(),loaded.getMentorship());
assertEquals(group.getMentorship().getId(),loaded.getMentorship().getId());
assertEquals(mentor, group.getMentorship().getMentor());
assertEquals(group, group.getMentorship().getGroup());
}