}
public void testFindExceptionCandidates(){
String mainSummary = "SUMMARY";
String secondSummary = "SECOND SUMMARY";
Exceptions except = new Exceptions();
Report report = new Report(5);
except.setReportId(report);
report.setIssueId(0);
except.setId(5);
except.setSummary(mainSummary);
persUtil.persist(report);
persUtil.persist(except);
for (int i = 0; i < 9; i++){
Exceptions exc2 = new Exceptions();
exc2.setId(i+6);
exc2.setSummary(secondSummary);
exc2.setReportId(report);
persUtil.persist(exc2);
}
List<Report> result = persUtil.findExceptionCandidates(9);
assertEquals("NUMBER OF CANDIDATES", 1, result.size());
// assertEquals("CANDIDATE ISSUE", mainSummary, result.get(0).getSummary());
result = persUtil.findExceptionCandidates(10);
assertEquals("NUMBER OF CANDIDATES", 0, result.size());
Exceptions exc2 = new Exceptions();
exc2.setId(20);
exc2.setSummary(secondSummary);
exc2.setReportId(report);
persUtil.persist(exc2);
result = persUtil.findExceptionCandidates(10);
assertEquals("NUMBER OF CANDIDATES", 1, result.size());
}