Search in sources :

Example 1 with EntityMethodGroupResponse

use of com.axibase.tsd.api.model.entity.EntityMethodGroupResponse in project atsd-api-test by axibase.

the class TokenEntityTest method testEntityGroupMethod.

@Test(description = "Tests entity group endpoint.")
@Issue("6052")
public void testEntityGroupMethod() throws Exception {
    String entityName = Mocks.entity();
    String url = "/entities/" + entityName + "/groups";
    String token = TokenRepository.getToken(username, HttpMethod.GET, url);
    EntityGroup group = new EntityGroup(Mocks.entityGroup());
    Entity entity = new Entity(entityName);
    createOrReplaceEntityCheck(entity);
    EntityGroupMethod.createOrReplaceEntityGroupCheck(group);
    EntityGroupMethod.addEntities(group.getName(), Collections.singletonList(entityName));
    Response response = queryEntityGroups(entityName, token);
    assertTrue(compareJsonString(Util.prettyPrint(Collections.singletonList(new EntityMethodGroupResponse(group))), response.readEntity(String.class)));
}
Also used : Response(javax.ws.rs.core.Response) EntityMethodGroupResponse(com.axibase.tsd.api.model.entity.EntityMethodGroupResponse) Entity(com.axibase.tsd.api.model.entity.Entity) EntityMethodGroupResponse(com.axibase.tsd.api.model.entity.EntityMethodGroupResponse) EntityGroup(com.axibase.tsd.api.model.entitygroup.EntityGroup) Issue(io.qameta.allure.Issue) EntityTest(com.axibase.tsd.api.method.entity.EntityTest) Test(org.testng.annotations.Test)

Aggregations

EntityTest (com.axibase.tsd.api.method.entity.EntityTest)1 Entity (com.axibase.tsd.api.model.entity.Entity)1 EntityMethodGroupResponse (com.axibase.tsd.api.model.entity.EntityMethodGroupResponse)1 EntityGroup (com.axibase.tsd.api.model.entitygroup.EntityGroup)1 Issue (io.qameta.allure.Issue)1 Response (javax.ws.rs.core.Response)1 Test (org.testng.annotations.Test)1