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