EventFacadeEjb implements EventFacade { @Override public List<DashboardEventDto> getNewEventsForDashboard(EventCriteria eventCriteria) { return eventService.getNewEventsForDashboard(eventCriteria); }  @Override List<String> getAllActiveUuids(); @Override List<EventDto> getAllActiveEventsAfter(Date date); @Override List<EventDto> getByUuids(List<String> uuids); @Override List<String> getDeletedUuidsSince(Date since); @Override List<DashboardEventDto> getNewEventsForDashboard(EventCriteria eventCriteria); Map<Disease, Long> getEventCountByDisease(EventCriteria eventCriteria); Map<EventStatus, Long> getEventCountByStatus(EventCriteria eventCriteria); @Override EventDto getEventByUuid(String uuid); @Override EventReferenceDto getReferenceByUuid(String uuid); @Override EventDto saveEvent(EventDto dto); @Override void deleteEvent(String eventUuid); @Override long count(EventCriteria eventCriteria); @Override List<EventIndexDto> getIndexList(EventCriteria eventCriteria, Integer first, Integer max, List<SortProperty> sortProperties); @Override List<EventExportDto> getExportList(EventCriteria eventCriteria, Integer first, Integer max); @Override boolean isArchived(String eventUuid); @Override boolean isDeleted(String eventUuid); @Override void archiveOrDearchiveEvent(String eventUuid, boolean archive); @Override List<String> getArchivedUuidsSince(Date since); Event fromDto(@NotNull EventDto source); EventDto convertToDto(Event source, Pseudonymizer pseudonymizer); static EventReferenceDto toReferenceDto(Event entity); static EventDto toDto(Event source); @Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) void archiveAllArchivableEvents(int daysAfterEventGetsArchived); @Override boolean exists(String uuid); @Override String getUuidByCaseUuidOrPersonUuid(String searchTerm); Boolean isEventEditAllowed(String eventUuid);  }
@Test public void testDashboardEventListCreation() { RDCF rdcf = creator.createRDCF("Region", "District", "Community", "Facility"); UserDto user = creator .createUser(rdcf.region.getUuid(), rdcf.district.getUuid(), rdcf.facility.getUuid(), "Surv", "Sup", UserRole.SURVEILLANCE_SUPERVISOR); EventDto event = creator.createEvent( EventStatus.SIGNAL, "Title", "Description", "First", "Name", "12345", TypeOfPlace.PUBLIC_PLACE, DateHelper.subtractDays(new Date(), 1), new Date(), user.toReference(), user.toReference(), Disease.EVD, rdcf.district); List<DashboardEventDto> dashboardEventDtos = getEventFacade().getNewEventsForDashboard( new EventCriteria().region(event.getEventLocation().getRegion()) .district(event.getEventLocation().getDistrict()) .disease(event.getDisease()) .reportedBetween(DateHelper.subtractDays(new Date(), 1), DateHelper.addDays(new Date(), 1))); assertEquals(1, dashboardEventDtos.size()); }