use of com.axibase.tsd.api.model.replacementtable.ReplacementTable in project atsd-api-test by axibase.
the class SqlLookupFunctionTest method prepareReplacementTable.
private static ReplacementTable prepareReplacementTable(String name) {
ReplacementTable table = ReplacementTable.of(name, SupportedFormat.LIST).addValue("-1", "negative").addValue("1", "positive").addValue("2", "2").addValue("word", "3").addValue("words", "letters").addValue("3", "-3").addValue("4", "3.14").addValue("PI", "3.14").addValue("3.14", "PI");
ReplacementTableMethod.createCheck(table);
return table;
}
use of com.axibase.tsd.api.model.replacementtable.ReplacementTable 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.model.replacementtable.ReplacementTable 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