Search in sources :

Example 1 with AlertDeleteQuery

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

the class TokenAlertTest method testDeleteMethod.

@Test(description = "Tests alert update endpoint with tokens.")
@Issue("6052")
public void testDeleteMethod() throws Exception {
    String url = "/alerts/delete";
    String token = TokenRepository.getToken(username, HttpMethod.POST, url);
    String entity = Mocks.entity();
    generateAlertForEntity(entity);
    AlertQuery query = new AlertQuery().setStartDate(Util.MIN_QUERYABLE_DATE).setEndDate(Util.MAX_QUERYABLE_DATE).setMetrics(Collections.singletonList(RULE_METRIC_NAME)).setEntity(entity);
    Alert alert = queryAlerts(query).readEntity(ResponseAsList.ofAlerts()).get(0);
    deleteAlerts(Collections.singletonList(new AlertDeleteQuery(alert.getId())), token);
    Checker.check(new DeletionCheck(new AlertCheck(query)));
}
Also used : AlertQuery(com.axibase.tsd.api.model.alert.AlertQuery) AlertDeleteQuery(com.axibase.tsd.api.model.alert.AlertDeleteQuery) AlertCheck(com.axibase.tsd.api.method.checks.AlertCheck) Alert(com.axibase.tsd.api.model.alert.Alert) DeletionCheck(com.axibase.tsd.api.method.checks.DeletionCheck) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) AlertTest(com.axibase.tsd.api.method.alert.AlertTest)

Aggregations

AlertTest (com.axibase.tsd.api.method.alert.AlertTest)1 AlertCheck (com.axibase.tsd.api.method.checks.AlertCheck)1 DeletionCheck (com.axibase.tsd.api.method.checks.DeletionCheck)1 Alert (com.axibase.tsd.api.model.alert.Alert)1 AlertDeleteQuery (com.axibase.tsd.api.model.alert.AlertDeleteQuery)1 AlertQuery (com.axibase.tsd.api.model.alert.AlertQuery)1 Issue (io.qameta.allure.Issue)1 Test (org.testng.annotations.Test)1