@Test
public void testConf() {

    // prepare properties
    Properties props = new Properties();
    // add alert (min. version)
    String prefix = AlertsPropertiesConfiguration.ALERT_PROP_PREFIX + "1.";
    props.put(prefix + AlertsPropertiesConfiguration.ID_PROP, "ID");
    props.put(prefix + AlertsPropertiesConfiguration.LIMIT_PROP, "11");
    props.put(prefix + AlertsPropertiesConfiguration.SQL_PROP, "select COUNT()");
    // add alert (max. version)
    prefix = AlertsPropertiesConfiguration.ALERT_PROP_PREFIX + "66.";
    props.put(prefix + AlertsPropertiesConfiguration.ID_PROP, "ID2");
    props.put(prefix + AlertsPropertiesConfiguration.LIMIT_PROP, "11");
    props.put(prefix + AlertsPropertiesConfiguration.SQL_PROP, "select COUNT()");
    props.put(prefix + AlertsPropertiesConfiguration.ENABLED_PROP, "true");
    props.put(prefix + AlertsPropertiesConfiguration.MAIL_SBJ_PROP, "subject");
    props.put(prefix + AlertsPropertiesConfiguration.MAIL_BODY_PROP, "body");
    env.getPropertySources().addFirst(new PropertiesPropertySource("alerts-test", props));
    // configure alerts
    AlertsPropertiesConfiguration conf = new AlertsPropertiesConfiguration(env);
    conf.initProps();
    // verify
    assertThat(conf.getAlert("ID"), notNullValue());
    assertThat(conf.getAlert("ID2"), notNullValue());
    AlertInfo alert1 = conf.getAlert("ID");
    assertThat(alert1.isEnabled(), is(true));
    assertThat(alert1.getSql(), is("select COUNT()"));
    assertThat(alert1.getLimit(), is(11L));
    assertThat(alert1.getNotificationSubject(), nullValue());
    assertThat(alert1.getNotificationBody(), nullValue());
    AlertInfo alert2 = conf.getAlert("ID2");
    assertThat(alert2.isEnabled(), is(true));
    assertThat(alert2.getSql(), is("select COUNT()"));
    assertThat(alert2.getLimit(), is(11L));
    assertThat(alert2.getNotificationSubject(), is("subject"));
    assertThat(alert2.getNotificationBody(), is("body"));
}