MRHistoryJobDailyReporter extends AbstractScheduledService { protected void sendByEmail(Map<String, Object> alertData) { emailService.onAlert(alertData); } MRHistoryJobDailyReporter(Config config);  static final String SERVICE_PATH; }
@Test public void test() throws Exception { MRHistoryJobDailyReporter reporter = new MRHistoryJobDailyReporter(config); reporter.sendByEmail(mockAlertData()); Iterator it = server.getReceivedEmail(); Assert.assertTrue(server.getReceivedEmailSize() == 1); while (it.hasNext()) { LOG.info(it.next().toString()); } }