### Question:
PushNotificationProcessorImpl implements PushNotificationProcessor { @Override public void processNotification(@Nonnull final Long notificationId, @Nonnull final Map<String, String> secureProperties) { Assert.notNull(notificationId, "Push notification id should not be null"); Assert.notNull(secureProperties, "Secure properties map should not be null"); logger.debug("Processing push notification for id - {}", notificationId); final PushNotification pushNotification = pushNotificationService.getPushNotificationForProcessing(notificationId); assertPushNotificationState(pushNotification); updatePushNotificationState(notificationId, NotificationState.PROCESSING); try { final String pushNotificationProviderExternalUuid = send(pushNotification, secureProperties); if (StringUtils.isNotBlank(pushNotificationProviderExternalUuid)) { logger.debug("Updating provider uuid for push notification with id - {}, uuid - {}", notificationId, pushNotificationProviderExternalUuid); updatePushNotificationExternalUuId(notificationId, pushNotificationProviderExternalUuid); } updatePushNotificationState(notificationId, NotificationState.SENT); } catch (final Exception ex) { final String message = "Error occurred while processing push notification with id - " + notificationId; updatePushNotificationState(notificationId, NotificationState.FAILED); throw new ServicesRuntimeException(message, ex); } } PushNotificationProcessorImpl(); @Override void processNotification(@Nonnull final Long notificationId, @Nonnull final Map<String, String> secureProperties);  }### Answer:
@Test public void testProcessPushNotificationWithInvalidArguments() { resetAll(); replayAll(); try { pushNotificationProcessingService.processNotification(null, Collections.emptyMap()); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } try { final Long notificationId = 1L; pushNotificationProcessingService.processNotification(notificationId, null); fail("Exception should be thrown"); } catch (final IllegalArgumentException ex) { } verifyAll(); }
@Test public void testProcessPushNotificationWithInvalidState() { final Long notificationId = 1L; final PushNotification notification = getServicesImplTestHelper().createPushNotification(); notification.setId(notificationId); notification.setState(NotificationState.PROCESSING); resetAll(); expect(pushNotificationService.getPushNotificationForProcessing(notificationId)).andReturn(notification).once(); replayAll(); try { pushNotificationProcessingService.processNotification(notificationId, Collections.emptyMap()); fail("Exception should be thrown"); } catch (final NotificationInvalidStateException ex) { assertNotificationInvalidStateException(ex, notificationId, notification.getState(), new LinkedHashSet<>(Arrays.asList(NotificationState.CREATED, NotificationState.FAILED))); } verifyAll(); }