WeeklyReportFacadeEjb implements WeeklyReportFacade { @Override public WeeklyReportDto getByEpiWeekAndUser(EpiWeek epiWeek, UserReferenceDto userRef) { User user = userService.getByReferenceDto(userRef); return toDto(weeklyReportService.getByEpiWeekAndUser(epiWeek, user)); }  @Override List<WeeklyReportDto> getAllWeeklyReportsAfter(Date date); @Override List<WeeklyReportDto> getByUuids(List<String> uuids); @Override WeeklyReportDto getByUuid(String uuid); @Override WeeklyReportDto saveWeeklyReport(WeeklyReportDto dto); @Override List<String> getAllUuids(); @Override List<WeeklyReportRegionSummaryDto> getSummariesPerRegion(EpiWeek epiWeek); @Override List<WeeklyReportOfficerSummaryDto> getSummariesPerOfficer(RegionReferenceDto regionRef, EpiWeek epiWeek); @Override WeeklyReportDto getByEpiWeekAndUser(EpiWeek epiWeek, UserReferenceDto userRef); WeeklyReport fromDto(@NotNull WeeklyReportDto source); WeeklyReportEntry fromDto(WeeklyReportEntryDto source); static WeeklyReportReferenceDto toReferenceDto(WeeklyReport entity); static WeeklyReportDto toDto(WeeklyReport source); static WeeklyReportEntryDto toDto(WeeklyReportEntry source); @RolesAllowed(UserRole._SYSTEM) @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) void generateSubmitWeeklyReportTasks();  }
@Test public void testGetByEpiWeekAndUser() { EpiWeek previousEpiWeek = DateHelper.getPreviousEpiWeek(new Date()); createFacilityInformantReport(informant1, new Date(), previousEpiWeek.getWeek(), previousEpiWeek.getYear(), 1); WeeklyReportDto report = getWeeklyReportFacade().getByEpiWeekAndUser(previousEpiWeek, informant1.toReference()); assertNotNull(report); report = getWeeklyReportFacade().getByEpiWeekAndUser(previousEpiWeek, informant2.toReference()); assertNull(report); }