### Question:
NotificationService { @Scheduled(cron = "${remind.cron}") @SchedulerLock(name = "remindNotifications") public void sendRemindNotifications() { List<Recipient> recipients = recipientRepository.readyToNotify(NotificationType.REMIND, LocalDate.now()); Flux.fromIterable(recipients) .publishOn(jdbcScheduler) .doOnNext(recipient -> { try { emailService.send(NotificationType.REMIND, recipient, null); recipient.markNotified(NotificationType.REMIND); recipientRepository.update(recipient); } catch (Exception e) { logger.error("Reminder notification for user '" + recipient.getUsername() + "' failed", e); } }).count() .subscribe(count -> logger.info("Reminder notification sent to {} recipients", count)); }  @Scheduled(cron = "${backup.cron}") @SchedulerLock(name = "backupNotifications") void sendBackupNotifications(); @Scheduled(cron = "${remind.cron}") @SchedulerLock(name = "remindNotifications") void sendRemindNotifications();  }### Answer:
@Test public void shouldSendRemindNotificationsEvenWhenErrorsOccurForSomeRecipients() throws Exception { doThrow(RuntimeException.class).when(emailService).send(NotificationType.REMIND, failed, null); notificationService.sendRemindNotifications(); verify(emailService).send(NotificationType.REMIND, successful, null); verify(recipientRepository).update(argThat(arg -> { assertThat(arg.getUsername()).isEqualTo(SUCCESSFUL); assertThat(arg.getNotifications().get(NotificationType.BACKUP).getNotifyDate()).isEqualTo(date); assertThat(arg.getNotifications().get(NotificationType.REMIND).getNotifyDate()).isAfter(date); return true; })); verify(recipientRepository, never()).update(failed); }