public class RelationshipEntityTests extends EntityTestBase {
@Test
@Transactional
public void testRelationshipCreate() {
Person p = persistedPerson("Michael", 35);
Person p2 = persistedPerson("David", 25);
Friendship f = p.knows(p2);
Relationship rel = getNodeState(p).getSingleRelationship(DynamicRelationshipType.withName("knows"), Direction.OUTGOING);
assertEquals(getRelationshipState(f), rel);
assertEquals(getNodeState(p2), rel.getEndNode());
}