Search in sources :

Example 1 with ReplacementTableCheck

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));
}
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 2 with ReplacementTableCheck

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));
}
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 3 with ReplacementTableCheck

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

ReplacementTableCheck (com.axibase.tsd.api.method.checks.ReplacementTableCheck)3 ReplacementTable (com.axibase.tsd.api.model.replacementtable.ReplacementTable)3 Issue (io.qameta.allure.Issue)3 Test (org.testng.annotations.Test)3 DeletionCheck (com.axibase.tsd.api.method.checks.DeletionCheck)1