ContactFacadeEjb implements ContactFacade { @Override public List<MapContactDto> getContactsForMap( RegionReferenceDto regionRef, DistrictReferenceDto districtRef, Disease disease, Date fromDate, Date toDate, List<MapCaseDto> mapCaseDtos) { User user = userService.getCurrentUser(); Region region = regionService.getByReferenceDto(regionRef); District district = districtService.getByReferenceDto(districtRef); List<String> caseUuids = new ArrayList<>(); for (MapCaseDto mapCaseDto : mapCaseDtos) { caseUuids.add(mapCaseDto.getUuid()); } if (user == null) { return Collections.emptyList(); } return contactService.getContactsForMap(region, district, disease, fromDate, toDate, user, caseUuids); }  @Override List<String> getAllActiveUuids(); @Override List<ContactDto> getAllActiveContactsAfter(Date date); @Override List<ContactDto> getByUuids(List<String> uuids); @Override List<String> getDeletedUuidsSince(Date since); @Override ContactDto getContactByUuid(String uuid); @Override Boolean isValidContactUuid(String uuid); @Override ContactReferenceDto getReferenceByUuid(String uuid); @Override ContactDto saveContact(ContactDto dto); @Override ContactDto saveContact(ContactDto dto, boolean handleChanges); @Override List<MapContactDto> getContactsForMap(
		RegionReferenceDto regionRef,
		DistrictReferenceDto districtRef,
		Disease disease,
		Date fromDate,
		Date toDate,
		List<MapCaseDto> mapCaseDtos); @Override void deleteContact(String contactUuid); @Override List<ContactExportDto> getExportList(ContactCriteria contactCriteria, int first, int max, Language userLanguage); @Override List<VisitSummaryExportDto> getVisitSummaryExportList(ContactCriteria contactCriteria, int first, int max, Language userLanguage); @Override long countMaximumFollowUpDays(ContactCriteria contactCriteria); @Override long count(ContactCriteria contactCriteria); @Override List<ContactFollowUpDto> getContactFollowUpList(
		ContactCriteria contactCriteria,
		Date referenceDate,
		int interval,
		Integer first,
		Integer max,
		List<SortProperty> sortProperties); @Override List<ContactIndexDto> getIndexList(ContactCriteria contactCriteria, Integer first, Integer max, List<SortProperty> sortProperties); @Override List<ContactIndexDetailedDto> getIndexDetailedList(
		ContactCriteria contactCriteria,
		Integer first,
		Integer max,
		List<SortProperty> sortProperties); @Override int[] getContactCountsByCasesForDashboard(List<Long> contactIds); @Override int getNonSourceCaseCountForDashboard(List<String> caseUuids); Contact fromDto(@NotNull ContactDto source); @Override boolean isDeleted(String contactUuid); @Override List<DashboardContactDto> getContactsForDashboard(
		RegionReferenceDto regionRef,
		DistrictReferenceDto districtRef,
		Disease disease,
		Date from,
		Date to); @Override List<DashboardQuarantineDataDto> getQuarantineDataForDashBoard(
		RegionReferenceDto regionRef,
		DistrictReferenceDto districtRef,
		Disease disease,
		Date from,
		Date to); @Override Map<ContactStatus, Long> getNewContactCountPerStatus(ContactCriteria contactCriteria); @Override Map<ContactClassification, Long> getNewContactCountPerClassification(ContactCriteria contactCriteria); @Override Map<FollowUpStatus, Long> getNewContactCountPerFollowUpStatus(ContactCriteria contactCriteria); @Override int getFollowUpUntilCount(ContactCriteria contactCriteria); ContactDto convertToDto(Contact source, Pseudonymizer pseudonymizer); static ContactReferenceDto toReferenceDto(Contact source); static ContactDto toDto(Contact source); @RolesAllowed(UserRole._SYSTEM) @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) void generateContactFollowUpTasks(); @Override void validate(ContactDto contact); @Override List<SimilarContactDto> getMatchingContacts(ContactSimilarityCriteria criteria); @Override boolean exists(String uuid); @Override boolean isContactEditAllowed(String contactUuid);  }
@Test public void testMapContactListCreation() { TestDataCreator.RDCF rdcf = creator.createRDCF("Region", "District", "Community", "Facility"); UserDto user = useSurveillanceOfficerLogin(rdcf); PersonDto cazePerson = creator.createPerson("Case", "Person"); CaseDataDto caze = creator.createCase( user.toReference(), cazePerson.toReference(), Disease.EVD, CaseClassification.PROBABLE, InvestigationStatus.PENDING, new Date(), rdcf); PersonDto contactPerson = creator.createPerson("Contact", "Person"); creator.createContact(user.toReference(), user.toReference(), contactPerson.toReference(), caze, new Date(), new Date(), null); MapCaseDto mapCaseDto = new MapCaseDto( caze.getUuid(), caze.getReportDate(), caze.getCaseClassification(), caze.getDisease(), caze.getPerson().getUuid(), cazePerson.getFirstName(), cazePerson.getLastName(), caze.getHealthFacility().getUuid(), 0d, 0d, caze.getReportLat(), caze.getReportLon(), caze.getReportLat(), caze.getReportLon(), null, null, null, null, null); List<MapContactDto> mapContactDtos = getContactFacade().getContactsForMap( caze.getRegion(), caze.getDistrict(), caze.getDisease(), DateHelper.subtractDays(new Date(), 1), DateHelper.addDays(new Date(), 1), Arrays.asList(mapCaseDto)); assertEquals(1, mapContactDtos.size()); }