use of com.axibase.tsd.api.method.checks.ReplacementTableCheck in project atsd-api-test by axibase.
the class TokenReplacementTableTest method testCreateMethod.
@Test(description = "Tests replacement table create or replace endpoint.")
@Issue("6052")
public void testCreateMethod() throws Exception {
String replacementTableName = Mocks.replacementTable();
String url = "/replacement-tables/json/" + replacementTableName;
String token = TokenRepository.getToken(username, HttpMethod.PUT, url);
ReplacementTable replacementTable = ReplacementTable.of(replacementTableName, SupportedFormat.JSON).addValue("key", "value");
createResponse(replacementTable, token);
Checker.check(new ReplacementTableCheck(replacementTable));
}
use of com.axibase.tsd.api.method.checks.ReplacementTableCheck in project atsd-api-test by axibase.
the class TokenReplacementTableTest method testUpdateMethod.
@Test(description = "Tests replacement table update endpoint.")
@Issue("6052")
public void testUpdateMethod() throws Exception {
String replacementTableName = Mocks.replacementTable();
String url = "/replacement-tables/json/" + replacementTableName;
String token = TokenRepository.getToken(username, "PATCH", url);
ReplacementTable replacementTable = ReplacementTable.of(replacementTableName, SupportedFormat.JSON).addValue("key", "value");
createCheck(replacementTable);
replacementTable.addValue("new-key", "new-value");
updateReplacementTableResponse(replacementTable, token);
Checker.check(new ReplacementTableCheck(replacementTable));
}
use of com.axibase.tsd.api.method.checks.ReplacementTableCheck 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)));
}
Aggregations