@Autowired ProjectDetailRepository projectDetailRepository;
@Autowired Neo4jTemplate template;
@Test
@Transactional
public void testCreatedProjectWithInheritance() throws Exception {
Project project = new Project();
project = projectRepository.save(project);
ProjectDetail projectDetail = new ProjectDetail(validName);
projectDetailRepository.save(projectDetail);
ProjectDetailRelationship projectDetailRelationship = new ProjectDetailRelationship(null, project, projectDetail);
template.save(projectDetailRelationship);
project.getProjectDetailRelationships().add(projectDetailRelationship);
project = projectRepository.save(project);
assertEquals(1, count(projectRepository.findAll()));
assertEquals(1, count(projectDetailRepository.findAll()));
ProjectDetail actualProjectDetail = projectDetailRepository.findAll().iterator().next();
assertEquals(validName, actualProjectDetail.getName());
assertEquals(project.getEntityId(), actualProjectDetail.getParentProject().getEntityId());
//all tests above pass without issue -- the test below fails: expected:<1> but was:<0>
Project actualProject = projectRepository.findOne(project.getEntityId());
assertEquals(1, actualProject.getProjectDetailRelationships().size());
}