Search in sources :

Example 6 with DeletionCheck

use of com.axibase.tsd.api.method.checks.DeletionCheck in project atsd-api-test by axibase.

the class TokenPropertyTest method testDeleteMethod.

@Test(description = "Tests properties delete endpoint with tokens.")
@Issue("6052")
public void testDeleteMethod() throws Exception {
    Property propertyToDelete = // creating data for deletion
    new Property(Mocks.propertyType(), Mocks.entity()).addTag(TAG_NAME, TAG_VALUE).setDate(ISO_TIME);
    insertPropertyCheck(propertyToDelete);
    String url = "/properties/delete";
    String token = TokenRepository.getToken(username, HttpMethod.POST, url);
    PropertyQuery query = new PropertyQuery(propertyToDelete.getType(), propertyToDelete.getEntity()).setStartDate(ISO_TIME).setEndDate(Util.MAX_QUERYABLE_DATE);
    deleteProperty(Collections.singletonList(query), token);
    Checker.check(new DeletionCheck(new PropertyCheck(propertyToDelete)));
}
Also used : PropertyQuery(com.axibase.tsd.api.model.property.PropertyQuery) DeletionCheck(com.axibase.tsd.api.method.checks.DeletionCheck) Property(com.axibase.tsd.api.model.property.Property) PropertyCheck(com.axibase.tsd.api.method.checks.PropertyCheck) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test) PropertyTest(com.axibase.tsd.api.method.property.PropertyTest)

Example 7 with DeletionCheck

use of com.axibase.tsd.api.method.checks.DeletionCheck in project atsd-api-test by axibase.

the class TokenReplacementTableTest method testDeleteMethod.

@Test(description = "Tests replacement table delete endpoint.")
@Issue("6052")
public void testDeleteMethod() throws Exception {
    String replacementTableName = Mocks.replacementTable();
    String url = "/replacement-tables/" + replacementTableName;
    String token = TokenRepository.getToken(username, HttpMethod.DELETE, url);
    ReplacementTable replacementTable = ReplacementTable.of(replacementTableName, SupportedFormat.JSON).addValue("key", "value");
    createCheck(replacementTable);
    deleteReplacementTableResponse(replacementTableName, token);
    Checker.check(new DeletionCheck(new ReplacementTableCheck(replacementTable)));
}
Also used : ReplacementTable(com.axibase.tsd.api.model.replacementtable.ReplacementTable) DeletionCheck(com.axibase.tsd.api.method.checks.DeletionCheck) ReplacementTableCheck(com.axibase.tsd.api.method.checks.ReplacementTableCheck) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Aggregations

DeletionCheck (com.axibase.tsd.api.method.checks.DeletionCheck)7 Issue (io.qameta.allure.Issue)7 Test (org.testng.annotations.Test)7 AlertTest (com.axibase.tsd.api.method.alert.AlertTest)1 AlertCheck (com.axibase.tsd.api.method.checks.AlertCheck)1 EntityCheck (com.axibase.tsd.api.method.checks.EntityCheck)1 EntityGroupCheck (com.axibase.tsd.api.method.checks.EntityGroupCheck)1 MetricCheck (com.axibase.tsd.api.method.checks.MetricCheck)1 PropertyCheck (com.axibase.tsd.api.method.checks.PropertyCheck)1 ReplacementTableCheck (com.axibase.tsd.api.method.checks.ReplacementTableCheck)1 SeriesCheck (com.axibase.tsd.api.method.checks.SeriesCheck)1 EntityTest (com.axibase.tsd.api.method.entity.EntityTest)1 MetricTest (com.axibase.tsd.api.method.metric.MetricTest)1 PropertyTest (com.axibase.tsd.api.method.property.PropertyTest)1 SeriesTest (com.axibase.tsd.api.method.series.SeriesTest)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 Entity (com.axibase.tsd.api.model.entity.Entity)1 EntityGroup (com.axibase.tsd.api.model.entitygroup.EntityGroup)1