@Test public void testGetMailContent() { Assert.assertFalse( MailNotificationUtil.getMailContent(ExecutableState.DISCARDED, Maps.<String, Object>newHashMap()) .startsWith("Cannot find email template for")); Assert.assertFalse(MailNotificationUtil.getMailContent(ExecutableState.ERROR, Maps.<String, Object>newHashMap()) .startsWith("Cannot find email template for")); Assert.assertFalse( MailNotificationUtil.getMailContent(ExecutableState.SUCCEED, Maps.<String, Object>newHashMap()) .startsWith("Cannot find email template for")); Assert.assertTrue( MailNotificationUtil.getMailContent(ExecutableState.RUNNING, Maps.<String, Object>newHashMap()) .startsWith("Cannot find email template for")); Assert.assertTrue( MailNotificationUtil.getMailContent(ExecutableState.STOPPED, Maps.<String, Object>newHashMap()) .startsWith("Cannot find email template for")); Assert.assertTrue(MailNotificationUtil.getMailContent(ExecutableState.READY, Maps.<String, Object>newHashMap()) .startsWith("Cannot find email template for")); }
public static String getMailContent(ExecutableState state, Map<String, Object> dataMap) { return MailTemplateProvider.getInstance().buildMailContent(MailNotificationUtil.getMailTemplateKey(state), dataMap); }
MailNotificationUtil { public static String getMailContent(ExecutableState state, Map<String, Object> dataMap) { return MailTemplateProvider.getInstance().buildMailContent(MailNotificationUtil.getMailTemplateKey(state), dataMap); } }
MailNotificationUtil { public static String getMailContent(ExecutableState state, Map<String, Object> dataMap) { return MailTemplateProvider.getInstance().buildMailContent(MailNotificationUtil.getMailTemplateKey(state), dataMap); } private  MailNotificationUtil(); }
MailNotificationUtil { public static String getMailContent(ExecutableState state, Map<String, Object> dataMap) { return MailTemplateProvider.getInstance().buildMailContent(MailNotificationUtil.getMailTemplateKey(state), dataMap); } private  MailNotificationUtil(); static String getLocalHostName(); static String getMailContent(ExecutableState state, Map<String, Object> dataMap); static String getMailContent(String key, Map<String, Object> dataMap); static String getMailTitle(String... titleParts); static boolean hasMailNotification(ExecutableState state); }
MailNotificationUtil { public static String getMailContent(ExecutableState state, Map<String, Object> dataMap) { return MailTemplateProvider.getInstance().buildMailContent(MailNotificationUtil.getMailTemplateKey(state), dataMap); } private  MailNotificationUtil(); static String getLocalHostName(); static String getMailContent(ExecutableState state, Map<String, Object> dataMap); static String getMailContent(String key, Map<String, Object> dataMap); static String getMailTitle(String... titleParts); static boolean hasMailNotification(ExecutableState state); static final String JOB_ERROR; static final String JOB_DISCARD; static final String JOB_SUCCEED; static final String METADATA_PERSIST_FAIL; static final String NA; }