NotificationActionFactory implements InitializingBean { @SuppressFBWarnings(value = "UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "This is a false positive. afterPropertiesSet is called before this method which will ensure notificationActionHandlerServiceMap is " + "not null.") public NotificationActionService getNotificationActionHandler(String notificationType, String actionType) { NotificationActionService actionHandlerService = notificationActionHandlerServiceMap.get(notificationType + "|" + actionType); if (actionHandlerService == null) { throw new IllegalArgumentException( "No supported notification handler found for notificationType \"" + notificationType + "\" and actionType: \"" + actionType + "\"."); } return actionHandlerService; }  @Override void afterPropertiesSet(); @SuppressFBWarnings(value = "UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR", justification = "This is a false positive. afterPropertiesSet is called before this method which will ensure notificationActionHandlerServiceMap is " + "not null.") NotificationActionService getNotificationActionHandler(String notificationType, String actionType);  }
@Test public void testCreateBusinessObjectDataNotificationNoHandler() throws Exception { try { notificationActionFactory.getNotificationActionHandler("NO_EXIST", "NO_EXIST"); fail("Should throw an IllegalArgumentException as no supported handler if defined for this notification event type."); } catch (IllegalArgumentException ex) { assertTrue(ex.getMessage().startsWith("No supported notification handler found for notificationType")); } }