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)));
}
Aggregations