mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
122594 jvonka: REST api fwk: pass through query params for DELETE method - also update REST api test fwk RA-837 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126483 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -194,10 +194,15 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
}
|
||||
|
||||
protected HttpResponse delete(String url, String runAsUser, String entityId, int expectedStatus) throws Exception
|
||||
{
|
||||
return delete(url, runAsUser, entityId, null, expectedStatus);
|
||||
}
|
||||
|
||||
protected HttpResponse delete(String url, String runAsUser, String entityId, Map<String, String> params, int expectedStatus) throws Exception
|
||||
{
|
||||
publicApiClient.setRequestContext(new RequestContext(runAsUser));
|
||||
|
||||
HttpResponse response = publicApiClient.delete(getScope(), url, entityId, null, null);
|
||||
HttpResponse response = publicApiClient.delete(getScope(), 1, url, entityId, null, null, params);
|
||||
checkStatus(expectedStatus, response.getStatusCode());
|
||||
|
||||
return response;
|
||||
|
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2016 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.rest.api.tests.client;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
@@ -552,7 +570,12 @@ public class PublicApiClient
|
||||
|
||||
public HttpResponse delete(String scope, String entityCollectionName, Object entityId, String relationCollectionName, Object relationshipEntityId) throws IOException
|
||||
{
|
||||
HttpResponse response = client.delete(getRequestContext(), scope, entityCollectionName, entityId, relationCollectionName, relationshipEntityId);
|
||||
return delete(scope, 1, entityCollectionName, entityId, relationCollectionName, relationshipEntityId, null);
|
||||
}
|
||||
|
||||
public HttpResponse delete(String scope, int version, String entityCollectionName, Object entityId, String relationCollectionName, Object relationshipEntityId, Map<String, String> params) throws IOException
|
||||
{
|
||||
HttpResponse response = client.delete(getRequestContext(), scope, version, entityCollectionName, entityId, relationCollectionName, relationshipEntityId, params);
|
||||
|
||||
logger.debug(response.toString());
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.alfresco.rest.api.tests.client;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
@@ -545,14 +544,14 @@ public class PublicApiHttpClient
|
||||
public HttpResponse delete(final RequestContext rq, final String scope, final String entityCollectionName, final Object entityId,
|
||||
final String relationCollectionName, final Object relationshipEntityId) throws IOException
|
||||
{
|
||||
return delete(rq, scope, 1, entityCollectionName, entityId, relationCollectionName, relationshipEntityId);
|
||||
return delete(rq, scope, 1, entityCollectionName, entityId, relationCollectionName, relationshipEntityId, null);
|
||||
}
|
||||
|
||||
public HttpResponse delete(final RequestContext rq, final String scope, final int version, final String entityCollectionName, final Object entityId,
|
||||
final String relationCollectionName, final Object relationshipEntityId) throws IOException
|
||||
final String relationCollectionName, final Object relationshipEntityId, final Map<String, String> params) throws IOException
|
||||
{
|
||||
RestApiEndpoint endpoint = new RestApiEndpoint(rq.getNetworkId(), scope, version, entityCollectionName, entityId, relationCollectionName,
|
||||
relationshipEntityId, null);
|
||||
relationshipEntityId, params);
|
||||
String url = endpoint.getUrl();
|
||||
|
||||
DeleteMethod req = new DeleteMethod(url);
|
||||
|
Reference in New Issue
Block a user