use of org.alfresco.rest.api.tests.client.HttpResponse in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method getAll.
protected HttpResponse getAll(Class<?> entityResource, PublicApiClient.Paging paging, Map<String, String> otherParams, int expectedStatus) throws Exception {
HttpResponse response = publicApiClient.get(entityResource, null, null, otherParams);
checkStatus(expectedStatus, response.getStatusCode());
return response;
}
use of org.alfresco.rest.api.tests.client.HttpResponse in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method getSingle.
protected HttpResponse getSingle(String url, String entityId, Map<String, String> params, int expectedStatus) throws Exception {
HttpResponse response = publicApiClient.get(getScope(), url, entityId, null, null, params);
checkStatus(expectedStatus, response.getStatusCode());
return response;
}
use of org.alfresco.rest.api.tests.client.HttpResponse in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method waitAndGetRendition.
protected Rendition waitAndGetRendition(String sourceNodeId, String renditionId, int maxRetry, long pauseTime) throws Exception {
int retryCount = 0;
while (retryCount < maxRetry) {
try {
HttpResponse response = getSingle(getNodeRenditionsUrl(sourceNodeId), renditionId, 200);
Rendition rendition = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Rendition.class);
assertNotNull(rendition);
assertEquals(Rendition.RenditionStatus.CREATED, rendition.getStatus());
return rendition;
} catch (AssertionError ex) {
// If the asynchronous create rendition action is not finished yet,
// wait for 'PAUSE_TIME' and try again.
retryCount++;
System.out.println("waitAndGetRendition: " + retryCount);
Thread.sleep(pauseTime);
}
}
return null;
}
use of org.alfresco.rest.api.tests.client.HttpResponse in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method getRootNodeId.
// -root- (eg. Company Home for on-prem)
protected String getRootNodeId() throws Exception {
HttpResponse response = getSingle(NodesEntityResource.class, Nodes.PATH_ROOT, null, 200);
Node node = RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Node.class);
return node.getId();
}
use of org.alfresco.rest.api.tests.client.HttpResponse in project alfresco-remote-api by Alfresco.
the class AbstractBaseApiTest method get.
public HttpResponse get(String url, Map<String, String> params, int expectedStatus) throws IOException {
HttpResponse response = publicApiClient.get(url, params);
checkStatus(expectedStatus, response.getStatusCode());
return response;
}
Aggregations