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