[R4] Avoid DataIntegrityViolationException for crm field

This commit is contained in:
Mirna Gama 2024-01-06 13:24:28 -03:00 committed by Mirna Gama
parent aa86a53458
commit 2632cee84d
2 changed files with 4 additions and 4 deletions

View File

@ -73,7 +73,7 @@ public class DoctorControllerTest {
@DisplayName("Should post valid doctor and return http status ok")
public void testPostValidDoctor() throws Exception {
DoctorDTO doctorDTO = new DoctorDTO("test", "test@gmail.com", "123456", "99999999", Specialty.ORTHOPEDICS,
DoctorDTO doctorDTO = new DoctorDTO("test", "test@gmail.com", "101010", "99999999", Specialty.ORTHOPEDICS,
new AddressDTO("TEST STREET", "NEIGHBORHOOD", "12345678", "CITY", "ST", null, null));
String doctorDTOContent = mapper.writeValueAsString(doctorDTO);
@ -90,7 +90,7 @@ public class DoctorControllerTest {
@DisplayName("Should not post invalid doctor and return http status bad request")
public void testPostInvalidDoctor() throws Exception {
DoctorDTO doctorDTO = new DoctorDTO("", "test@gmail.com", "123456", "99999999", Specialty.ORTHOPEDICS,
DoctorDTO doctorDTO = new DoctorDTO("", "test@gmail.com", "111111", "99999999", Specialty.ORTHOPEDICS,
new AddressDTO("TEST STREET", "NEIGHBORHOOD", "12345678", "CITY", "ST", null, null));
String doctorDTOContent = mapper.writeValueAsString(doctorDTO);

View File

@ -76,7 +76,7 @@ public class DoctorServiceTest {
@Test
@DisplayName("Should add valid doctor")
public void testAddValidDoctor() throws Exception {
DoctorDTO doctorDTO = new DoctorDTO("test", "test@gmail.com", "123456", "99999999", Specialty.ORTHOPEDICS,
DoctorDTO doctorDTO = new DoctorDTO("test", "test@gmail.com", "101010", "99999999", Specialty.ORTHOPEDICS,
new AddressDTO("TEST STREET", "NEIGHBORHOOD", "12345678", "CITY", "ST", null, null));
Doctor doctor = doctorService.addDoctor(doctorDTO);
@ -90,7 +90,7 @@ public class DoctorServiceTest {
@Test
@DisplayName("Should not add doctor with invalid parameter")
public void testAddInvalidDoctor() throws Exception {
DoctorDTO doctorDTO = new DoctorDTO("", "test@gmail.com", "123456", "99999999", Specialty.ORTHOPEDICS,
DoctorDTO doctorDTO = new DoctorDTO("", "test@gmail.com", "111111", "99999999", Specialty.ORTHOPEDICS,
new AddressDTO("TEST STREET", "NEIGHBORHOOD", "12345678", "CITY", "ST", null, null));
assertThrows(ConstraintViolationException.class, () -> doctorService.addDoctor(doctorDTO));