|
40 | 40 | import de.symeda.sormas.api.externalmessage.processing.ExternalMessageProcessingResult;
|
41 | 41 | import de.symeda.sormas.api.infrastructure.facility.FacilityDto;
|
42 | 42 | import de.symeda.sormas.api.infrastructure.facility.FacilityType;
|
| 43 | +import de.symeda.sormas.api.person.PersonCriteria; |
43 | 44 | import de.symeda.sormas.api.person.PersonDto;
|
44 | 45 | import de.symeda.sormas.api.person.Sex;
|
45 | 46 | import de.symeda.sormas.api.sample.PathogenTestDto;
|
@@ -310,6 +311,29 @@ public void testProcessWithExistingPersonWithSameNationalHealthIdButDifferentDet
|
310 | 311 | assertThat(getPathogenTestFacade().getAllActiveUuids(), hasSize(0));
|
311 | 312 | }
|
312 | 313 |
|
| 314 | + @Test |
| 315 | + public void testProcessWithExistingPersonWithSameNationalHealthIdAndPersonDetailsNormalizedCheck() |
| 316 | + throws ExecutionException, InterruptedException { |
| 317 | + ExternalMessageDto externalMessage = createExternalMessage(m -> { |
| 318 | + m.setPersonFirstName("john vander"); |
| 319 | + m.setPersonLastName("DOÉ"); |
| 320 | + m.setPersonCity(" PERSON city \n"); |
| 321 | + m.setPersonStreet(" person STREET 12A"); |
| 322 | + }); |
| 323 | + |
| 324 | + creator.createPerson("John Van Der", "Doe", Sex.MALE, p -> { |
| 325 | + p.setNationalHealthId(externalMessage.getPersonNationalHealthId()); |
| 326 | + p.getAddress().setCity("person city"); |
| 327 | + p.getAddress().setStreet("PERSON STREET, 12a"); |
| 328 | + }); |
| 329 | + |
| 330 | + ProcessingResult<ExternalMessageProcessingResult> result = runFlow(externalMessage); |
| 331 | + assertThat(result.getStatus(), is(DONE)); |
| 332 | + assertThat(externalMessage.getStatus(), is(ExternalMessageStatus.PROCESSED)); |
| 333 | + assertThat(getExternalMessageFacade().getByUuid(externalMessage.getUuid()).getStatus(), is(ExternalMessageStatus.PROCESSED)); |
| 334 | + assertThat(getPersonFacade().count(new PersonCriteria()), is(1L)); |
| 335 | + } |
| 336 | + |
313 | 337 | @Test
|
314 | 338 | public void testProcessWithExistingSimilarPerson() throws ExecutionException, InterruptedException {
|
315 | 339 | ExternalMessageDto externalMessage = createExternalMessage(m -> m.setPersonNationalHealthId(null));
|
|
0 commit comments