@Test
public void testSubjectDefaultTemplate() {

    String subject = formatter.formatSubject(null, createEvent());
    Assert.assertEquals("[SEVERE] Alert TestPattern", subject.trim());
    // test recovery path
    Map<String, Object> data = new HashMap<>();
    data.put("alertLevel", "CRITICAL");
    data.put("alertAttribute", "recovery");
    data.put("alertBackToNormal", true);
    data.put("alertPattern", "message:*");
    Event event = new Event("foo", data);
    subject = formatter.formatSubject(null, event);
    Assert.assertEquals("Alert on message:* is back to normal", subject.trim());
}