@Test
public void addAlerts() throws Exception {

    int numTenants = 2;
    int numTriggers = 5;
    int numAlerts = 100;
    createTestAlerts(numTenants, numTriggers, numAlerts);
    Set<String> tenantIds = new HashSet<>();
    tenantIds.add("tenant0");
    tenantIds.add("tenant1");
    assertEquals(2 * 5 * 100, alerts.getAlerts(tenantIds, null, null).size());
    tenantIds.remove("tenant0");
    assertEquals(1 * 5 * 100, alerts.getAlerts(tenantIds, null, null).size());
    List<Alert> testAlerts = alerts.getAlerts(tenantIds, null, null);
    tenantIds.clear();
    Set<String> alertIds = new HashSet<>();
    for (int i = 0; i < 3; i++) {
        Alert alertX = testAlerts.get(i);
        tenantIds.add(alertX.getTenantId());
        alertIds.add(alertX.getAlertId());
    }
    AlertsCriteria criteria = new AlertsCriteria();
    criteria.setAlertIds(alertIds);
    assertEquals(3, alerts.getAlerts(tenantIds, criteria, null).size());
    deleteTestAlerts(numTenants);
}