### Question:
NotificationProcessingServiceImpl implements NotificationProcessingService { @Override public void processNotification(@Nonnull final Long notificationId, @Nonnull final Map<String, String> secureProperties) { Assert.notNull(notificationId, "Notification id should not be null"); Assert.notNull(secureProperties, "Secure properties map should not be null"); LOGGER.debug("Processing notification with id - {}", notificationId); final Notification notification = notificationService.getNotificationById(notificationId); final NotificationProcessor notificationProcessor = getNotificationProcessorForType(notification.getType()); notificationProcessor.processNotification(notification.getId(), secureProperties); LOGGER.debug("Successfully processed notification with id - {}, notification - {}", notificationId, notification); } NotificationProcessingServiceImpl(); @Override void processNotification(@Nonnull final Long notificationId, @Nonnull final Map<String, String> secureProperties); PushNotificationProcessor getPushNotificationProcessor(); void setPushNotificationProcessor(final PushNotificationProcessor pushNotificationProcessor); SmsNotificationProcessor getSmsNotificationProcessor(); void setSmsNotificationProcessor(final SmsNotificationProcessor smsNotificationProcessor); NotificationService getNotificationService(); void setNotificationService(final NotificationService notificationService); EmailNotificationProcessor getEmailNotificationProcessor(); void setEmailNotificationProcessor(final EmailNotificationProcessor emailNotificationProcessor);  }### Answer:
@Test public void testProcessNotificationWithInvalidArguments() { resetAll(); replayAll(); try { notificationProcessingService.processNotification(null, Collections.emptyMap()); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } try { final Long notificationId = 1L; notificationProcessingService.processNotification(notificationId, null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }
@Test public void testProcessNotificationWithEmailNotification() { final Long notificationId = 1L; final Notification notification = getServicesImplTestHelper().createEmailNotification(); notification.setId(notificationId); resetAll(); expect(notificationService.getNotificationById(eq(notificationId))).andReturn(notification).once(); emailNotificationProcessor.processNotification(eq(notificationId), eq(Collections.emptyMap())); expectLastCall(); replayAll(); notificationProcessingService.processNotification(notificationId, Collections.emptyMap()); verifyAll(); }
@Test public void testProcessNotificationWithSmsNotification() { final Long notificationId = 1L; final Notification notification = getServicesImplTestHelper().createSmsNotification(); notification.setId(notificationId); resetAll(); expect(notificationService.getNotificationById(eq(notificationId))).andReturn(notification).once(); smsNotificationProcessor.processNotification(eq(notificationId), eq(Collections.emptyMap())); expectLastCall(); replayAll(); notificationProcessingService.processNotification(notificationId, Collections.emptyMap()); verifyAll(); }
@Test public void testProcessNotificationWithPushNotification() { final Long notificationId = 1L; final Notification notification = getServicesImplTestHelper().createPushNotification(); notification.setId(notificationId); resetAll(); expect(notificationService.getNotificationById(eq(notificationId))).andReturn(notification).once(); pushNotificationProcessor.processNotification(eq(notificationId), eq(Collections.emptyMap())); expectLastCall(); replayAll(); notificationProcessingService.processNotification(notificationId, Collections.emptyMap()); verifyAll(); }