Search in sources :

Example 1 with RequestBuilder

use of org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder in project alfresco-remote-api by Alfresco.

the class AbstractBaseApiTest method delete.

protected HttpResponse delete(String url, String entityId, Map<String, String> params, Map<String, String> headers, String apiName, int expectedStatus) throws Exception {
    RequestBuilder requestBuilder = httpClient.new DeleteRequestBuilder().setRequestContext(publicApiClient.getRequestContext()).setScope(getScope()).setApiName(apiName).setEntityCollectionName(url).setEntityId(entityId).setParams(params).setHeaders(headers);
    HttpResponse response = publicApiClient.execute(requestBuilder);
    checkStatus(expectedStatus, response.getStatusCode());
    return response;
}
Also used : RequestBuilder(org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder) HttpResponse(org.alfresco.rest.api.tests.client.HttpResponse)

Example 2 with RequestBuilder

use of org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder in project alfresco-remote-api by Alfresco.

the class AbstractBaseApiTest method post.

protected HttpResponse post(String url, String body, Map<String, String> params, Map<String, String> headers, String apiName, int expectedStatus) throws Exception {
    RequestBuilder requestBuilder = httpClient.new PostRequestBuilder().setBodyAsString(body).setRequestContext(publicApiClient.getRequestContext()).setScope(getScope()).setApiName(apiName).setEntityCollectionName(url).setHeaders(headers).setParams(params);
    HttpResponse response = publicApiClient.execute(requestBuilder);
    checkStatus(expectedStatus, response.getStatusCode());
    return response;
}
Also used : RequestBuilder(org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder) HttpResponse(org.alfresco.rest.api.tests.client.HttpResponse)

Example 3 with RequestBuilder

use of org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder in project alfresco-remote-api by Alfresco.

the class AbstractBaseApiTest method post.

protected HttpResponse post(String url, byte[] body, Map<String, String> params, Map<String, String> headers, String apiName, String contentType, int expectedStatus) throws Exception {
    RequestBuilder requestBuilder = httpClient.new PostRequestBuilder().setBodyAsByteArray(body).setContentType(contentType).setRequestContext(publicApiClient.getRequestContext()).setScope(getScope()).setApiName(apiName).setEntityCollectionName(url).setHeaders(headers).setParams(params);
    HttpResponse response = publicApiClient.execute(requestBuilder);
    checkStatus(expectedStatus, response.getStatusCode());
    return response;
}
Also used : RequestBuilder(org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder) HttpResponse(org.alfresco.rest.api.tests.client.HttpResponse)

Aggregations

HttpResponse (org.alfresco.rest.api.tests.client.HttpResponse)3 RequestBuilder (org.alfresco.rest.api.tests.client.PublicApiHttpClient.RequestBuilder)3