PasswordReminderEventHandler { @MotechListener(subjects = PASSWORD_CHANGE_REMINDER_EVENT) public void handleEvent(MotechEvent event) { emailSender.sendPasswordResetReminder(event.getParameters()); } @Autowired  PasswordReminderEventHandler(EmailSender emailSender); @MotechListener(subjects = PASSWORD_CHANGE_REMINDER_EVENT) void handleEvent(MotechEvent event);  }
@Test public void shouldSendEmailForHandledEvent() { eventHandler.handleEvent(event); verify(emailSender).sendPasswordResetReminder(event.getParameters()); }