return workReportDAO.getAll().size();
}
});
WorkReportDTO workReportDTO = createWorkReportDTO(workReportTypeCode);
WorkReportListDTO workReportListDTO = new WorkReportListDTO(Arrays
.asList(workReportDTO));
InstanceConstraintViolationsListDTO instanceConstraintViolationsListDTO = workReportService
.addWorkReports(workReportListDTO);
assertThat(
instanceConstraintViolationsListDTO.instanceConstraintViolationsList
.size(), equalTo(0));
List<WorkReport> workReports = transactionService
.runOnTransaction(new IOnTransaction<List<WorkReport>>() {
@Override
public List<WorkReport> execute() {
List<WorkReport> list = workReportDAO.getAll();
for (WorkReport workReport : list) {
Set<WorkReportLine> workReportLines = workReport
.getWorkReportLines();
for (WorkReportLine line : workReportLines) {
line.getEffort().getHours();
}
}
return list;
}
});
assertThat(workReports.size(), equalTo(previous + 1));
Set<WorkReportLine> workReportLines = workReports.get(previous)
.getWorkReportLines();
assertThat(workReportLines.size(), equalTo(1));
assertThat(workReportLines.iterator().next().getEffort(),
equalTo(EffortDuration.sum(EffortDuration.hours(8),
EffortDuration.minutes(15))));
workReportDTO.workReportLines.add(createWorkReportLineDTO());
WorkReportListDTO workReportListDTO2 = new WorkReportListDTO(Arrays
.asList(workReportDTO));
instanceConstraintViolationsListDTO = workReportService
.addWorkReports(workReportListDTO2);
assertThat(