Skip to content

Commit bcd5d1b

Browse files
committed
fix tests
1 parent 949764a commit bcd5d1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/com/capgemini/training/appointmentbooking/logic/impl/ManageAppointmentUcImplTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ void shouldBookAppointment() {
8282
AppointmentEntity appointmentEntity = buildAppointmentEntity(clientId, specialistId, treatmentId, dateTime, status);
8383

8484
when(findAppointmentUc.hasConflictingAppointment(specialistId, dateTime)).thenReturn(false);
85-
when(clientRepository.findById(appointmentBookingEto.clientId())).thenReturn(Optional.of(new ClientEntity()));
86-
when(treatmentRepository.findById(appointmentBookingEto.treatmentId())).thenReturn(Optional.of(new TreatmentEntity()));
85+
when(clientRepository.getReferenceById(appointmentBookingEto.clientId())).thenReturn(new ClientEntity());
86+
when(treatmentRepository.getReferenceById(appointmentBookingEto.treatmentId())).thenReturn((new TreatmentEntity()));
8787
when(appointmentRepository.saveAndFlush(any())).thenReturn(appointmentEntity);
8888

8989
// when

0 commit comments

Comments
 (0)