Search in sources :

Example 1 with AlertHistoryQuery

use of com.axibase.tsd.api.model.alert.AlertHistoryQuery in project atsd-api-test by axibase.

the class AlertHistoryQueryTest method testUnknownEntityNotAffectProcessingOthers.

@Issue("2993")
@Test(enabled = false)
public void testUnknownEntityNotAffectProcessingOthers() throws Exception {
    AlertHistoryQuery qExist = templateQuery().setEntity("alert-historyquery-entity-1");
    AlertHistoryQuery qUnknown = templateQuery().setEntity("UNKNOWN");
    List<Alert> resultList = AlertMethod.queryHistory(qExist, qUnknown);
    assertEquals("Fail to get alert history by queries with unknown entity", 2, resultList.size());
    assertEquals("Unexpected warning message", "ENTITY not found for name: 'unknown'", resultList.get(1).getWarning());
}
Also used : AlertHistoryQuery(com.axibase.tsd.api.model.alert.AlertHistoryQuery) Alert(com.axibase.tsd.api.model.alert.Alert) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 2 with AlertHistoryQuery

use of com.axibase.tsd.api.model.alert.AlertHistoryQuery in project atsd-api-test by axibase.

the class AlertHistoryQueryTest method generateAlertHistory.

@BeforeClass(enabled = false)
public void generateAlertHistory() throws Exception {
    Registry.Entity.checkExists(ALERTHISTORY_ENTITY_NAME);
    generateAlertForEntity(ALERTHISTORY_ENTITY_NAME);
    AlertHistoryQuery query = templateQuery().setEntity(ALERTHISTORY_ENTITY_NAME).setLimit(1);
    Checker.check(new AlertHistorySizeQueryCheck(query, 1));
}
Also used : AlertHistoryQuery(com.axibase.tsd.api.model.alert.AlertHistoryQuery) AlertHistorySizeQueryCheck(com.axibase.tsd.api.method.checks.AlertHistorySizeQueryCheck) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with AlertHistoryQuery

use of com.axibase.tsd.api.model.alert.AlertHistoryQuery in project atsd-api-test by axibase.

the class AlertHistoryQueryTest method templateQuery.

private AlertHistoryQuery templateQuery() {
    AlertHistoryQuery query = new AlertHistoryQuery();
    query.setStartDate(MIN_QUERYABLE_DATE);
    query.setEndDate(MAX_QUERYABLE_DATE);
    query.setMetric(RULE_METRIC_NAME);
    return query;
}
Also used : AlertHistoryQuery(com.axibase.tsd.api.model.alert.AlertHistoryQuery)

Aggregations

AlertHistoryQuery (com.axibase.tsd.api.model.alert.AlertHistoryQuery)3 AlertHistorySizeQueryCheck (com.axibase.tsd.api.method.checks.AlertHistorySizeQueryCheck)1 Alert (com.axibase.tsd.api.model.alert.Alert)1 Issue (io.qameta.allure.Issue)1 BeforeClass (org.testng.annotations.BeforeClass)1 Test (org.testng.annotations.Test)1