@Test public void testBuildMessage() { String messageCode = "messages.test"; Object[] params = new Object[] { "one", "two", "three" }; Mockito.when( messageSource.getMessage(messageCode, params, Locale.getDefault())).thenReturn( "This is one for testing two. three."); Event event = new Event(); event.setMessageCode(messageCode); String msg = notificationService.buildMessage(event, params); Assert.assertEquals("This is one for testing two. three.", msg); Mockito.verify(messageSource).getMessage(messageCode, params, Locale.getDefault()); }
@Override public String buildMessage(Event event, Object[] params) { return messageSource.getMessage(event.getMessageCode(), params, Locale.getDefault()); }
NotificationServiceImpl extends BaseCrudServiceImpl<Notification> implements NotificationService { @Override public String buildMessage(Event event, Object[] params) { return messageSource.getMessage(event.getMessageCode(), params, Locale.getDefault()); } }
NotificationServiceImpl extends BaseCrudServiceImpl<Notification> implements NotificationService { @Override public String buildMessage(Event event, Object[] params) { return messageSource.getMessage(event.getMessageCode(), params, Locale.getDefault()); }  }
NotificationServiceImpl extends BaseCrudServiceImpl<Notification> implements NotificationService { @Override public String buildMessage(Event event, Object[] params) { return messageSource.getMessage(event.getMessageCode(), params, Locale.getDefault()); }  @Scheduled(fixedDelayString = "${notification.delay}") @Transactional void executeNotification(); void notify(String userId); void notify(String userId, int timezoneDiff); @Override String buildMessage(Event event, Object[] params); @Override void triggerEvent(Event event, BaseEntity command); @Override long countNewPopup(long userId); @Override void clearPopup(long userId); @Override Map<String, Object> getPopupNotification(long userId); @Override Map<String, Object> getPopupNotification(long userId,
			int timezoneDiff); @Override List<Notification> findMostRecentPopup(long userId); }
NotificationServiceImpl extends BaseCrudServiceImpl<Notification> implements NotificationService { @Override public String buildMessage(Event event, Object[] params) { return messageSource.getMessage(event.getMessageCode(), params, Locale.getDefault()); }  @Scheduled(fixedDelayString = "${notification.delay}") @Transactional void executeNotification(); void notify(String userId); void notify(String userId, int timezoneDiff); @Override String buildMessage(Event event, Object[] params); @Override void triggerEvent(Event event, BaseEntity command); @Override long countNewPopup(long userId); @Override void clearPopup(long userId); @Override Map<String, Object> getPopupNotification(long userId); @Override Map<String, Object> getPopupNotification(long userId,
			int timezoneDiff); @Override List<Notification> findMostRecentPopup(long userId);  }