Search in sources :

Example 1 with PropertyCheck

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

the class TokenPropertyTest method testInsertMethod.

@Test(description = "Tests properties insert endpoint with tokens.")
@Issue("6052")
public void testInsertMethod() throws Exception {
    String url = "/properties/insert";
    String token = TokenRepository.getToken(username, HttpMethod.POST, url);
    Property insertedProperty = new Property(Mocks.propertyType(), Mocks.entity()).addTag(TAG_NAME, TAG_VALUE).setDate(ISO_TIME);
    insertProperty(Collections.singletonList(insertedProperty), token);
    Checker.check(new PropertyCheck(insertedProperty));
}
Also used : 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 2 with PropertyCheck

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

the class PropertyTest method assertPropertyTypeExist.

public static void assertPropertyTypeExist(String propertyType) {
    String assertMessage = String.format("Fail to find property type %s in ATSD", propertyType);
    try {
        Check propertyCheck = new Check(assertMessage, () -> PropertyTest.propertyTypeExist(propertyType));
        Checker.check(propertyCheck);
    } catch (NotCheckedException e) {
        fail(assertMessage);
    }
}
Also used : NotCheckedException(com.axibase.tsd.api.util.NotCheckedException) PropertyCheck(com.axibase.tsd.api.method.checks.PropertyCheck) Check(com.axibase.tsd.api.method.checks.Check)

Example 3 with PropertyCheck

use of com.axibase.tsd.api.method.checks.PropertyCheck 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)

Aggregations

PropertyCheck (com.axibase.tsd.api.method.checks.PropertyCheck)3 PropertyTest (com.axibase.tsd.api.method.property.PropertyTest)2 Property (com.axibase.tsd.api.model.property.Property)2 Issue (io.qameta.allure.Issue)2 Test (org.testng.annotations.Test)2 Check (com.axibase.tsd.api.method.checks.Check)1 DeletionCheck (com.axibase.tsd.api.method.checks.DeletionCheck)1 PropertyQuery (com.axibase.tsd.api.model.property.PropertyQuery)1 NotCheckedException (com.axibase.tsd.api.util.NotCheckedException)1