@Test
public void queryEventsByCTime() throws Exception {

    int numTenants = 1;
    int numTriggers = 5;
    int numEvents = 5;
    createTestEvents(numTenants, numTriggers, numEvents);
    Set<String> tenantIds = new HashSet<>();
    tenantIds.add("tenant0");
    EventsCriteria criteria = new EventsCriteria();
    criteria.setStartTime(2L);
    criteria.setEndTime(2L);
    List<Event> ctime2Events = alerts.getEvents(tenantIds, criteria, null);
    assertEquals(5, ctime2Events.size());
    criteria.setEndTime(null);
    List<Event> ctimeGTE2Events = alerts.getEvents(tenantIds, criteria, null);
    assertEquals(5 * 4, ctimeGTE2Events.size());
    deleteTestEvents(numTenants);
}