Commit 471725c8 authored by Franck Desaize's avatar Franck Desaize
Browse files

Update TU

parent 6c37135c
Pipeline #263950 failed with stages
in 6 minutes and 51 seconds
......@@ -51,8 +51,9 @@ public class CrossReferenceSearchProcessingService {
if (searchParameter.size() != 2) {
throw new IllegalArgumentException("ProcessRequest.input shall contain two parameters to retrieve Xref !");
} else if (!CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME.equals(searchParameter.get(0).getName()) || !CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME.equals(searchParameter.get(1).getName())) {
throw new IllegalArgumentException(String.format("ProcessRequest.input shall have the name '%s' for a %s operation !",
throw new IllegalArgumentException(String.format("ProcessRequest.inputs shall have the name '%s' and '%s' for a %s operation !",
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME,
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME,
CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_PATIENT_SEARCH_OPERATION));
}
try {
......
......@@ -65,6 +65,7 @@ public class PatientSearchDAOTest {
* Test Patient search on UUID with a unique patient in DB.
*/
@Test
public void patient_search_uuid_unique_patient() throws SearchException, PatientCreationException, PatientDeleteException {
Patient patient = new Patient();
String uuid = "test-uuid0";
......@@ -213,7 +214,7 @@ public class PatientSearchDAOTest {
@Test
public void patientSearchDomainMultiplePatient() throws SearchException, PatientCreationException, PatientDeleteException {
Patient patient = new Patient();
String uuid = "test-uuid0";
String uuid = "test-uuid0°";
patient.setUuid(uuid);
String identifier = "test-identifier";
String systemIdentifier = "system-identifier";
......@@ -225,7 +226,7 @@ public class PatientSearchDAOTest {
patientDAO.createPatient(patient);
Patient patient1 = new Patient();
String uuid1 = "test-uuid1";
String uuid1 = "test-uuid10";
patient1.setUuid(uuid1);
EntityIdentifier entityIdentifier1 = new EntityIdentifier();
entityIdentifier1.setValue("tutu");
......@@ -390,7 +391,7 @@ public class PatientSearchDAOTest {
@Test
public void patientSearchIdentifierAndDomainMultiplePatient() throws SearchException, PatientCreationException, PatientDeleteException {
Patient patient = new Patient();
String uuid = "test-uuid0";
String uuid = "test-uuid345";
String identifier = "test-identifier";
String systemIdentifier = "system-identifier";
......@@ -403,7 +404,7 @@ public class PatientSearchDAOTest {
patientDAO.createPatient(patient);
Patient patient1 = new Patient();
String uuid1 = "test-uuid1";
String uuid1 = "test-uuid134";
patient1.setUuid(uuid1);
EntityIdentifier entityIdentifier1 = new EntityIdentifier();
entityIdentifier1.setValue(identifier);
......
......@@ -12,6 +12,9 @@ import net.ihe.gazelle.lib.gitbutils.adapter.MappingException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
class CrossReferenceSearchProcessingServiceTest {
......@@ -57,6 +60,7 @@ class CrossReferenceSearchProcessingServiceTest {
try {
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME, sourceIdentifier));
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME, new ArrayList<String>()));
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME, sourceIdentifier2));
} catch (MappingException e) {
fail("No exception is supposed to be thrown when transforming test patient to AnyContent !", e);
......@@ -77,6 +81,8 @@ class CrossReferenceSearchProcessingServiceTest {
try {
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent("Bad input name", sourceIdentifier));
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME, new ArrayList<String>()));
} catch (MappingException e) {
fail("No exception is supposed to be thrown when transforming test patient to AnyContent !", e);
}
......@@ -93,9 +99,13 @@ class CrossReferenceSearchProcessingServiceTest {
EntityIdentifier sourceIdentifier = new EntityIdentifier();
sourceIdentifier.setSystemIdentifier("nullResult");
sourceIdentifier.setValue("identifierValue");
List<String> targetDomains = new ArrayList<>();
targetDomains.add("test");
try {
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME, sourceIdentifier));
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME, targetDomains));
} catch (MappingException e) {
fail("No exception is supposed to be thrown when transforming test patient to AnyContent !", e);
}
......@@ -112,9 +122,11 @@ class CrossReferenceSearchProcessingServiceTest {
EntityIdentifier sourceIdentifier = new EntityIdentifier();
sourceIdentifier.setSystemIdentifier("Exception");
sourceIdentifier.setValue("identifierValue");
List<String> targetDomains = new ArrayList<>();
targetDomains.add("test");
try {
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME, sourceIdentifier));
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME, targetDomains));
} catch (MappingException e) {
fail("No exception is supposed to be thrown when transforming test patient to AnyContent !", e);
}
......@@ -142,9 +154,11 @@ class CrossReferenceSearchProcessingServiceTest {
EntityIdentifier sourceIdentifier = new EntityIdentifier();
sourceIdentifier.setSystemIdentifier("identifierSystem");
sourceIdentifier.setValue("identifierValue");
List<String> targetDomains = new ArrayList<>();
targetDomains.add("test");
try {
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_NAME, sourceIdentifier));
processRequest.getInput().add(new MapperObjectToAnyContent().getAnyContent(CrossReferenceProcessingWebServiceConstants.CROSS_REFERENCE_INPUT_TARGET_NAME,targetDomains ));
} catch (MappingException e) {
fail("No exception is supposed to be thrown when transforming test patient to AnyContent !", e);
}
......
......@@ -21,8 +21,7 @@ public class TestClientWithUrl {
XRefSearchClient xRefSearchClient = new XRefSearchClient(patientRegistryUrl);
EntityIdentifier entityIdentifier = new EntityIdentifier();
entityIdentifier.setSystemName("ASIP-SANTE-INS-C");
entityIdentifier.setSystemIdentifier("1.3.6.1.4.1.12559.11.1.2.2.5");
entityIdentifier.setSystemIdentifier("2.16.756.5.30.1.127.3.10.81");
entityIdentifier.setType("ISO");
entityIdentifier.setValue("1610749172368102389526");
List<String> targetDomain = new ArrayList<>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment