diff --git a/api/src/test/java/org/openmrs/api/PatientServiceTest.java b/api/src/test/java/org/openmrs/api/PatientServiceTest.java index a4f3d1c0610..f0ea5a908f4 100644 --- a/api/src/test/java/org/openmrs/api/PatientServiceTest.java +++ b/api/src/test/java/org/openmrs/api/PatientServiceTest.java @@ -2039,6 +2039,11 @@ public void purgePatient_shouldDeletePatientFromDatabase() throws Exception { assertNull(patientService.getPatient(2)); } + @Test + public void purgePatient_shouldThrowIllegalArgumentExceptionWhenPatientIsNull() { + assertThrows(IllegalArgumentException.class, () -> patientService.purgePatient(null)); + } + @Test public void getPatients_shouldNotReturnVoidedPatients() throws Exception { executeDataSet(FIND_PATIENTS_XML);