use of com.axibase.tsd.api.method.checks.DeletionCheck 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)));
}
use of com.axibase.tsd.api.method.checks.DeletionCheck in project atsd-api-test by axibase.
the class TokenEntityTest method testDeleteMethod.
@Test(description = "Tests entity delete endpoint.")
@Issue("6052")
public void testDeleteMethod() throws Exception {
String entityName = Mocks.entity();
String url = "/entities/" + entityName;
String token = TokenRepository.getToken(username, HttpMethod.DELETE, url);
Entity entity = new Entity(entityName);
createOrReplaceEntityCheck(entity);
deleteEntity(entityName, token);
Checker.check(new DeletionCheck(new EntityCheck(entity)));
}
use of com.axibase.tsd.api.method.checks.DeletionCheck in project atsd-api-test by axibase.
the class TokenMetricTest method testDeleteMethod.
@Test(description = "Tests metric delete endpoint.")
@Issue("6052")
public void testDeleteMethod() throws Exception {
String metricName = Mocks.metric();
String url = "/metrics/" + metricName;
String token = TokenRepository.getToken(username, HttpMethod.DELETE, url);
Metric metric = new Metric(metricName);
createOrReplaceMetricCheck(metric);
deleteMetric(metricName, token);
Checker.check(new DeletionCheck(new MetricCheck(metric)));
}
use of com.axibase.tsd.api.method.checks.DeletionCheck in project atsd-api-test by axibase.
the class TokenEntityGroupTest method testDeleteMethod.
@Test(description = "Tests entity group delete endpoint.")
@Issue("6052")
public void testDeleteMethod() throws Exception {
String entityGroupName = Mocks.entityGroup();
String url = "/entity-groups/" + entityGroupName;
String token = TokenRepository.getToken(username, HttpMethod.DELETE, url);
EntityGroup entityGroup = new EntityGroup(entityGroupName);
createOrReplaceEntityGroupCheck(entityGroup);
deleteEntityGroup(entityGroupName, token);
Checker.check(new DeletionCheck(new EntityGroupCheck(entityGroup)));
}
use of com.axibase.tsd.api.method.checks.DeletionCheck in project atsd-api-test by axibase.
the class TokenSeriesTest method testDeleteMethod.
@Test(description = "Tests series delete endpoint with tokens.")
@Issue("6052")
public void testDeleteMethod() throws Exception {
// creating data for series that will be deleted
String deletionEntity = Mocks.entity();
String deletionMetric = Mocks.metric();
Series deletionSeries = new Series(deletionEntity, deletionMetric);
deletionSeries.addSamples(Sample.ofDateInteger(SAMPLE_TIME, VALUE));
insertSeriesCheck(deletionSeries);
String deleteURL = "/series/delete";
SeriesQuery deleteQuery = new SeriesQuery(deletionEntity, deletionMetric);
String deleteToken = TokenRepository.getToken(username, HttpMethod.POST, deleteURL);
deleteSeries(Collections.singletonList(deleteQuery), deleteToken);
// checking that series was successfully deleted
Checker.check(new DeletionCheck(new SeriesCheck(Collections.singletonList(deletionSeries))));
}
Aggregations