@Test
public void testExecuteScheduledAlerts_DuringDatalagPresentWithNoDataTriggerWithSkippedEvaluation() {

    ServiceFactory sFactory = system.getServiceFactory();
    UserService userService = sFactory.getUserService();
    int triggerMinValue = 50, inertiaPeriod = 1000;
    int cooldownPeriod = 1000 * 5;
    final AtomicInteger notificationCount = new AtomicInteger(0);
    final AtomicInteger clearCount = new AtomicInteger(0);
    Metric metric = new Metric("scope", "metric");
    Map<Long, Double> datapoints = new HashMap<>();
    metric.setDatapoints(datapoints);
    Alert alert = new Alert(userService.findAdminUser(), userService.findAdminUser(), "testAlert", "-1h:scope:metric:avg", "* * * * *");
    _setAlertId(alert, "100001");
    Trigger trigger = new Trigger(alert, TriggerType.NO_DATA, "testTrigger", triggerMinValue, inertiaPeriod);
    _setTriggerId(trigger, "100002");
    Notification notification = new Notification("testNotification", alert, AuditNotifier.class.getName(), new ArrayList<String>(),
            cooldownPeriod);
    _setNotificationId(notification, "100003");
    alert.setTriggers(Arrays.asList(trigger));
    alert.setNotifications(Arrays.asList(notification));
    notification.setTriggers(alert.getTriggers());
    alert.setEnabled(true);
    DefaultAlertService spyAlertService = _initializeSpyAlertServiceWithStubs(notificationCount, clearCount,
            Arrays.asList(), alert, notification, true);
    MetricQueryResult queryResult = new MetricQueryResult();
    queryResult.addInboundMetricQuery(new MetricQuery("scope", "metric", null, 0L, 5000L));
    when(_metricServiceMock.extractDCFromMetricQuery(anyList())).thenReturn(new ArrayList<>(Arrays.asList("DC1")));
    when(_metricServiceMock.getMetrics(anyString(), anyLong())).thenReturn(queryResult);
    assertEquals(new Integer(0), spyAlertService.executeScheduledAlerts(1, 1000));
    assertEquals(0, notificationCount.get());
    enableDatalagMonitoring(false);
}