}
@Test
public void issueRelationsAreCreatedAndLoadedOK() {
try {
IssueRelation relation = createTwoRelatedIssues();
Issue issue = issueManager.getIssueById(relation.getIssueId(),
Include.relations);
Issue issueTarget = issueManager.getIssueById(relation.getIssueToId(),
Include.relations);
assertThat(issue.getRelations().size()).isEqualTo(1);
assertThat(issueTarget.getRelations().size()).isEqualTo(1);
IssueRelation relation1 = issue.getRelations().iterator().next();
assertEquals(issue.getId(), relation1.getIssueId());
assertEquals(issueTarget.getId(), relation1.getIssueToId());
assertEquals("precedes", relation1.getType());
assertEquals((Integer) 0, relation1.getDelay());
IssueRelation reverseRelation = issueTarget.getRelations().iterator().next();
// both forward and reverse relations are the same!
assertEquals(relation1, reverseRelation);
} catch (Exception e) {
fail(e.toString());
}