[R4] Unit test method for deactiva doctor in service class
This commit is contained in:
parent
1ca5714d85
commit
aa86a53458
@ -2,6 +2,7 @@ package com.mirna.hospitalmanagementapi.unit.application.service;
|
|||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
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.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
||||||
@ -121,4 +122,18 @@ public class DoctorServiceTest {
|
|||||||
|
|
||||||
assertEquals(doctorUpdatedData.name(), doctor.getName());
|
assertEquals(doctorUpdatedData.name(), doctor.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deactivates a existing doctor by id
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@DisplayName("Should deactivate a doctor")
|
||||||
|
public void testDeactivateDoctor() throws Exception {
|
||||||
|
|
||||||
|
Long id = testDoctor.getId();
|
||||||
|
|
||||||
|
Doctor doctor = doctorService.deactivateDoctor(id);
|
||||||
|
|
||||||
|
assertFalse(doctor.getActive());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user