}
// own transaction handling because of http://wiki.neo4j.org/content/Delete_Semantics
@Test(expected = NotFoundException.class)
public void testDeleteEntityFromGDC() {
Transaction tx = graphDatabaseContext.beginTx();
Person p = persistedPerson("Michael", 35);
Person spouse = persistedPerson("Tina", 36);
p.setSpouse(spouse);
long id = spouse.getId();
graphDatabaseContext.removeNodeEntity(spouse);
tx.success();
tx.finish();
Assert.assertNull("spouse removed " + p.getSpouse(), p.getSpouse());
Person spouseFromIndex = personRepository.findByPropertyValue(Person.NAME_INDEX, "name", "Tina");
Assert.assertNull("spouse not found in index",spouseFromIndex);
Assert.assertNull("node deleted " + id, graphDatabaseContext.getNodeById(id));
}