@Test
public void queryEventsByTriggerId() throws Exception {

    int numTenants = 2;
    int numTriggers = 5;
    int numEvents = 5;
    createTestEvents(numTenants, numTriggers, numEvents);
    Set<String> tenantIds = new HashSet<>();
    tenantIds.add("tenant0");
    tenantIds.add("tenant1");
    EventsCriteria criteria = new EventsCriteria();
    criteria.setTriggerId("trigger0");
    List<Event> trigger0Events = alerts.getEvents(tenantIds, criteria, null);
    assertEquals(10, trigger0Events.size());
    criteria.setTriggerIds(Arrays.asList("trigger0", "trigger1", "trigger2"));
    List<Event> trigger012Events = alerts.getEvents(tenantIds, criteria, null);
    assertEquals(30, trigger012Events.size());
    deleteTestEvents(numTenants);
}