@Test
public void queryAlertsByCTime() throws Exception {

    int numTenants = 1;
    int numTriggers = 5;
    int numAlerts = 5;
    createTestAlerts(numTenants, numTriggers, numAlerts);
    Set<String> tenantIds = new HashSet<>();
    tenantIds.add("tenant0");
    AlertsCriteria criteria = new AlertsCriteria();
    criteria.setStartTime(2L);
    criteria.setEndTime(2L);
    List<Alert> ctime2Alerts = alerts.getAlerts(tenantIds, criteria, null);
    assertEquals(5, ctime2Alerts.size());
    criteria.setEndTime(null);
    List<Alert> ctimeGTE2Alerts = alerts.getAlerts(tenantIds, criteria, null);
    assertEquals(5 * 4, ctimeGTE2Alerts.size());
    deleteTestAlerts(numTenants);
}