@Test
public void testOnAlert() {

    // prepare data
    String subject = "Alert: notification about WAITING messages";
    String body = "There are %d message(s) in WAITING_FOR_RESPONSE state for more then %d seconds.";
    AlertInfo alert = new AlertInfo("ID", 1, "sql", true, subject, body);
    int actualCount = 3;
    // action
    alertListener.onAlert(alert, actualCount);
    // verify
    verify(emailServiceMock, only()).sendEmailToAdmins(subject, alertListener.formatBody(alert, actualCount));
}