@Test
public void testGetTriggerFiredDatapointTimeWhenMissingTimeStampsReturnNull() {

    UserService userService = system.getServiceFactory().getUserService();
    Alert alert = new Alert(userService.findAdminUser(), userService.findAdminUser(), "alert-name_test", EXPRESSION, "* * * * *");
    Metric metric = new Metric("scope", "metric");
    double thresholdValue = 1;
    long inertia = 5*60*1000;
    Trigger trigger = new Trigger(alert, TriggerType.GREATER_THAN_OR_EQ, "name_test", thresholdValue, inertia);
    Map<Long, Double> datapoints = new HashMap<>();
    datapoints.put(0L, 1.0);
    datapoints.put(2*60*1000L, 0.0);
    datapoints.put(inertia, 1.0);
    metric.setDatapoints(datapoints);
    Long actualValue = alertService.getTriggerFiredDatapointTime(trigger, metric, alert.getExpression(), 1L);
    assertNull(actualValue);
}