@Test
public void loadTemplatesFromPropertiesWithLocaleTest() throws Exception {

    Alert openAlert = JvmGarbageCollectionData.getOpenAlert();
    Action openAction = new Action(openAlert.getTriggerId(), "email", "email-to-test", openAlert);
    openAction.setProperties(properties);
    ActionMessage openMessage = new TestActionMessage(openAction);
    // This template can be defined as default at plugin level
    properties.put("template.plain", "Tiny template: ${emailSubject}");
    // These template can be defined per action level
    properties.put("template.plain.es", "ES Tiny template: ${emailSubject}");
    properties.put("template.plain.fr", "FR Tiny template: ${emailSubject}");
    properties.put("template.locale", "es");
    EmailTemplate template = new EmailTemplate();
    Map<String, String> processed = template.processTemplate(openMessage);
    assertNotNull(processed.get("emailBodyPlain"));
    assertEquals("Processed template", processed.get("emailBodyPlain"), "ES Tiny template: Alert [open] message: " +
            "GC Duration greater than 1000.0 ms for App Server thevault~Local");
    properties.put("template.locale", "fr");
    processed = template.processTemplate(openMessage);
    assertNotNull(processed.get("emailBodyPlain"));
    assertEquals("Processed template", processed.get("emailBodyPlain"), "FR Tiny template: Alert [open] message: " +
            "GC Duration greater than 1000.0 ms for App Server thevault~Local");
    properties.remove("template.plain");
    properties.remove("template.locale");
}