mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
128681 jvonka: V1 REST API: version history - add api sanity check for auto-version on metadata-only updates REPO-348, REPO-313, REPO-905 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@129184 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -742,7 +742,12 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
return RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
}
|
||||
|
||||
protected Document createEmptyTextFile(Folder parentFolder, String docName) throws Exception
|
||||
protected Document createEmptyTextFile(String parentFolderId, String docName) throws Exception
|
||||
{
|
||||
return createEmptyTextFile(parentFolderId, docName, null, 201);
|
||||
}
|
||||
|
||||
protected Document createEmptyTextFile(String parentFolderId, String docName, Map<String, String> params, int expectedStatus) throws Exception
|
||||
{
|
||||
Document d1 = new Document();
|
||||
d1.setName(docName);
|
||||
@@ -752,17 +757,17 @@ public abstract class AbstractBaseApiTest extends EnterpriseTestApi
|
||||
d1.setContent(ci);
|
||||
|
||||
// create empty file
|
||||
HttpResponse response = post(getNodeChildrenUrl(parentFolder.getId()), toJsonAsStringNonNull(d1), 201);
|
||||
HttpResponse response = post(getNodeChildrenUrl(parentFolderId), toJsonAsStringNonNull(d1), params, null, "alfresco", expectedStatus);
|
||||
return RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
}
|
||||
|
||||
protected Document updateTextFile(String contentId, String textContent, Map<String, String> parameters) throws IOException, Exception
|
||||
protected Document updateTextFile(String contentId, String textContent, Map<String, String> params) throws IOException, Exception
|
||||
{
|
||||
ByteArrayInputStream inputStream = new ByteArrayInputStream(textContent.getBytes());
|
||||
File txtFile = TempFileProvider.createTempFile(inputStream, getClass().getSimpleName(), ".txt");
|
||||
BinaryPayload payload = new BinaryPayload(txtFile);
|
||||
|
||||
HttpResponse response = putBinary(getNodeContentUrl(contentId), payload, null, parameters, 200);
|
||||
HttpResponse response = putBinary(getNodeContentUrl(contentId), payload, null, params, 200);
|
||||
return RestApiUtil.parseRestApiEntry(response.getJsonResponse(), Document.class);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user