### Question:
AlertController { @PostMapping(value = "alert_removed_shifts") public BaseResponse alertRemovedShifts(@RequestBody @Validated AlertRemovedShiftsRequest request) { alertService.alertRemovedShifts(request); return BaseResponse.builder().message("removed shifts alerted").build(); }  @PostMapping(value = "alert_new_shift") BaseResponse alertNewShift(@RequestBody @Validated AlertNewShiftRequest request); @PostMapping(value = "alert_new_shifts") BaseResponse alertNewShifts(@RequestBody @Validated AlertNewShiftsRequest request); @PostMapping(value = "alert_removed_shift") BaseResponse alertRemovedShift(@RequestBody @Validated AlertRemovedShiftRequest request); @PostMapping(value = "alert_removed_shifts") BaseResponse alertRemovedShifts(@RequestBody @Validated AlertRemovedShiftsRequest request); @PostMapping(value = "alert_changed_shifts") BaseResponse alertChangedShifts(@RequestBody @Validated AlertChangedShiftRequest request);  }### Answer:
@Test public void testRemovedShifts() { ShiftDto shiftDto1 = ShiftDto.builder() .id(UUID.randomUUID().toString()) .companyId(companyId) .teamId(teamId) .jobId(jobId) .published(true) .userId(userId) .start(Instant.now().plus(2, ChronoUnit.DAYS)) .stop(Instant.now().plus(3, ChronoUnit.DAYS)) .build(); ShiftDto shiftDto2 = ShiftDto.builder() .id(UUID.randomUUID().toString()) .companyId(companyId) .teamId(teamId) .jobId(jobId) .published(true) .userId(userId) .start(Instant.now().plus(4, ChronoUnit.DAYS)) .stop(Instant.now().plus(5, ChronoUnit.DAYS)) .build(); ShiftDto shiftDto3 = ShiftDto.builder() .id(UUID.randomUUID().toString()) .companyId(companyId) .teamId(teamId) .jobId(jobId) .published(true) .userId(userId) .start(Instant.now().plus(6, ChronoUnit.DAYS)) .stop(Instant.now().plus(7, ChronoUnit.DAYS)) .build(); ShiftDto shiftDto4 = ShiftDto.builder() .id(UUID.randomUUID().toString()) .companyId(companyId) .teamId(teamId) .jobId(jobId) .published(true) .userId(userId) .start(Instant.now().plus(8, ChronoUnit.DAYS)) .stop(Instant.now().plus(9, ChronoUnit.DAYS)) .build(); Instant startAfter = Instant.now(); Instant startBefore = Instant.now().plus(BotConstant.SHIFT_WINDOW, ChronoUnit.DAYS); ShiftList shiftList = ShiftList.builder() .shiftStartAfter(startAfter) .shiftStartBefore(startBefore) .build(); shiftList.getShifts().add(shiftDto3); shiftList.getShifts().add(shiftDto4); when(companyClient.listWorkerShifts(anyString(), any(WorkerShiftListRequest.class))) .thenReturn(new GenericShiftListResponse(shiftList)); AlertRemovedShiftsRequest alertRemovedShiftsRequest = AlertRemovedShiftsRequest.builder() .userId(userId) .build(); alertRemovedShiftsRequest.getOldShifts().add(shiftDto1); alertRemovedShiftsRequest.getOldShifts().add(shiftDto2); BaseResponse baseResponse = botClient.alertRemovedShifts(alertRemovedShiftsRequest); log.info(baseResponse.toString()); assertThat(baseResponse.isSuccess()).isTrue(); ArgumentCaptor<EmailRequest> argument = ArgumentCaptor.forClass(EmailRequest.class); verify(mailClient, times(1)).send(argument.capture()); EmailRequest emailRequest = argument.getValue(); log.info(emailRequest.toString()); assertThat(emailRequest.getTo()).isEqualTo(accountDto.getEmail()); assertThat(emailRequest.getName()).isEqualTo(accountDto.getName()); assertThat(emailRequest.getSubject()).isEqualTo("Removed Shifts Alert"); assertThat(emailRequest.getHtmlBody()).contains(accountDto.getName(), companyDto.getName()); }