[R8] Unit test method for deactivate patient in service class
This commit is contained in:
parent
f4794bf08d
commit
9c27831992
@ -1,6 +1,7 @@
|
||||
package com.mirna.hospitalmanagementapi.unit.application.service;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
@ -131,4 +132,18 @@ public class PatientServiceTest {
|
||||
|
||||
assertEquals(patientUpdatedData.name(), patient.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivates an existing patient by id
|
||||
*/
|
||||
@Test
|
||||
@DisplayName("Should deactivate a patient")
|
||||
public void testDeactivatePatient() throws Exception {
|
||||
|
||||
Long id = testPatient.getId();
|
||||
|
||||
Patient patient = patientService.deactivatePatient(id);
|
||||
|
||||
assertFalse(patient.getActive());
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user