Search in sources :

Example 1 with PatientIdentifierTypeDefaultComparator

use of org.openmrs.comparator.PatientIdentifierTypeDefaultComparator in project openmrs-core by openmrs.

the class PatientServiceTest method getPatientIdentifierTypes_shouldOrderAsDefaultComparator.

/**
 * @see PatientService#getPatientIdentifierTypes(String,String,Boolean,Boolean)
 */
@Test
public void getPatientIdentifierTypes_shouldOrderAsDefaultComparator() throws Exception {
    List<PatientIdentifierType> list = patientService.getPatientIdentifierTypes(null, null, false, null);
    List<PatientIdentifierType> sortedList = new ArrayList<>(list);
    sortedList.sort(new PatientIdentifierTypeDefaultComparator());
    Assert.assertEquals(sortedList, list);
}
Also used : PatientIdentifierTypeDefaultComparator(org.openmrs.comparator.PatientIdentifierTypeDefaultComparator) ArrayList(java.util.ArrayList) PatientIdentifierType(org.openmrs.PatientIdentifierType) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) PatientServiceImplTest(org.openmrs.api.impl.PatientServiceImplTest) Test(org.junit.Test)

Example 2 with PatientIdentifierTypeDefaultComparator

use of org.openmrs.comparator.PatientIdentifierTypeDefaultComparator in project openmrs-core by openmrs.

the class PatientServiceTest method getAllPatientIdentifierTypes_shouldOrderAsDefaultComparator.

/**
 * @see PatientService#getAllPatientIdentifierTypes(boolean)
 */
@Test
public void getAllPatientIdentifierTypes_shouldOrderAsDefaultComparator() throws Exception {
    List<PatientIdentifierType> list = patientService.getAllPatientIdentifierTypes();
    List<PatientIdentifierType> sortedList = new ArrayList<>(list);
    sortedList.sort(new PatientIdentifierTypeDefaultComparator());
    Assert.assertEquals(sortedList, list);
}
Also used : PatientIdentifierTypeDefaultComparator(org.openmrs.comparator.PatientIdentifierTypeDefaultComparator) ArrayList(java.util.ArrayList) PatientIdentifierType(org.openmrs.PatientIdentifierType) BaseContextSensitiveTest(org.openmrs.test.BaseContextSensitiveTest) PatientServiceImplTest(org.openmrs.api.impl.PatientServiceImplTest) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 PatientIdentifierType (org.openmrs.PatientIdentifierType)2 PatientServiceImplTest (org.openmrs.api.impl.PatientServiceImplTest)2 PatientIdentifierTypeDefaultComparator (org.openmrs.comparator.PatientIdentifierTypeDefaultComparator)2 BaseContextSensitiveTest (org.openmrs.test.BaseContextSensitiveTest)2