Search in sources :

Example 6 with ReplacementTable

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;
}
Also used : ReplacementTable(com.axibase.tsd.api.model.replacementtable.ReplacementTable)

Example 7 with ReplacementTable

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));
}
Also used : ReplacementTable(com.axibase.tsd.api.model.replacementtable.ReplacementTable) ReplacementTableCheck(com.axibase.tsd.api.method.checks.ReplacementTableCheck) Issue(io.qameta.allure.Issue) Test(org.testng.annotations.Test)

Example 8 with 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)));
}
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

ReplacementTable (com.axibase.tsd.api.model.replacementtable.ReplacementTable)8 Issue (io.qameta.allure.Issue)4 Test (org.testng.annotations.Test)4 ReplacementTableCheck (com.axibase.tsd.api.method.checks.ReplacementTableCheck)3 Response (javax.ws.rs.core.Response)2 DeletionCheck (com.axibase.tsd.api.method.checks.DeletionCheck)1 NotCheckedException (com.axibase.tsd.api.util.NotCheckedException)1 ProcessingException (javax.ws.rs.ProcessingException)1