### Question:
DirectNotificationProcessor { private void processNotification(final Long notificationId, final Map<String, String> secureProperties) { CompletableFuture.runAsync(() -> notificationProcessingService.processNotification(notificationId, secureProperties), executor).whenComplete((aVoid, th) -> { if (th != null) { logger.error("Failure when sending notifications directly, notification id is {}", notificationId, th); } else { logger.debug("Notification with id {} was successfully sent.", notificationId); } }); } DirectNotificationProcessor(final NotificationProcessingService notificationProcessingService,
                                final PushNotificationSubscriptionRequestProcessingService pushNotificationSubscriptionRequestProcessingService,
                                final ApplicationEventDistributionService applicationEventDistributionService,
                                final Executor executor);   }### Answer:
@Test public void testSendingNotification() { final StartSendingNotificationEvent event = new StartSendingNotificationEvent(1L, Collections.singletonMap("testKey", "testValue")); doAnswer(invocation -> { final Runnable runnable = invocation.getArgument(0); runnable.run(); return null; }).when(persistenceUtilityService).runInPersistenceSession(isA(Runnable.class)); applicationEventDistributionService.publishAsynchronousEvent(event); verify(notificationProcessingService).processNotification(event.getNotificationId(), event.getSecureProperties()); }