mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
adding CMIS rest api calls on RestCmisAPI class
This commit is contained in:
@@ -14,6 +14,7 @@ import org.alfresco.utility.data.DataLink;
|
|||||||
import org.alfresco.utility.data.DataSite;
|
import org.alfresco.utility.data.DataSite;
|
||||||
import org.alfresco.utility.data.DataUser;
|
import org.alfresco.utility.data.DataUser;
|
||||||
import org.alfresco.utility.data.DataWorkflow;
|
import org.alfresco.utility.data.DataWorkflow;
|
||||||
|
import org.alfresco.utility.model.SiteModel;
|
||||||
import org.alfresco.utility.network.ServerHealth;
|
import org.alfresco.utility.network.ServerHealth;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -63,11 +64,14 @@ public abstract class RestTest extends AbstractTestNGSpringContextTests
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected WorkflowService workflow;
|
protected WorkflowService workflow;
|
||||||
|
|
||||||
|
protected SiteModel testSite;
|
||||||
|
|
||||||
@BeforeSuite(alwaysRun = true)
|
@BeforeSuite(alwaysRun = true)
|
||||||
public void checkServerHealth() throws Exception
|
public void checkServerHealth() throws Exception
|
||||||
{
|
{
|
||||||
super.springTestContextPrepareTestInstance();
|
super.springTestContextPrepareTestInstance();
|
||||||
serverHealth.assertServerIsOnline();
|
serverHealth.assertServerIsOnline();
|
||||||
|
testSite = dataSite.createPublicRandomSite();
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeMethod(alwaysRun=true)
|
@BeforeMethod(alwaysRun=true)
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.alfresco.rest.cmis;
|
||||||
|
|
||||||
|
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||||
|
import org.alfresco.rest.RestTest;
|
||||||
|
import org.alfresco.rest.core.RestResponse;
|
||||||
|
import org.alfresco.utility.model.FileModel;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
|
public class CmisBrowserTest extends RestTest
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* @author: Paul Brodner
|
||||||
|
* simple test for demo purposes on how to use CMIS browser binding with Rest
|
||||||
|
*/
|
||||||
|
@Test(enabled=false)
|
||||||
|
public void assertContentDispositionHeaderOnCmisFile() throws Exception
|
||||||
|
{
|
||||||
|
FileModel document = dataContent.usingUser(dataUser.getAdminUser())
|
||||||
|
.usingSite(testSite).createContent(DocumentType.HTML);
|
||||||
|
|
||||||
|
RestResponse response = restClient.authenticateUser(dataUser.getAdminUser()).withCMISApi().getRootObjectByID(document);
|
||||||
|
response.assertThat().header("Content-Disposition", String.format("attachment; filename=%s", document.getName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user