mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
test- fixed bamboo issues
This commit is contained in:
+29
-23
@@ -1,5 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processes.items;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestTest;
|
||||
@@ -16,7 +17,6 @@ import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.BeforeMethod;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class DeleteProcessItemFullTests extends RestTest
|
||||
@@ -38,18 +38,13 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
document = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
}
|
||||
|
||||
@BeforeMethod(alwaysRun = true)
|
||||
public void createProcess() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Try to delete existing process item using empty processId")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void deleteProcessItemUsingEmptyProcessId() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
document2 = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.MSPOWERPOINT);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
@@ -69,6 +64,8 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void createUpdateDeleteProcessItem() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
document2 = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.MSPOWERPOINT);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
@@ -86,7 +83,7 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
description = "Delete process item using any user.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void deleteProcessItemByAnyUser() throws Exception
|
||||
{
|
||||
{
|
||||
anotherUser = dataUser.createRandomTestUser();
|
||||
|
||||
document2 = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.HTML);
|
||||
@@ -108,6 +105,9 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void deleteProcessItemWithAdmin() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
|
||||
document2 = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.HTML);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document2);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
@@ -124,6 +124,9 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void deleteProcessItemByUserInvolvedInTheProcess() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
@@ -139,6 +142,8 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void deleteProcessItemByUserThatStartedTheProcess() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
@@ -154,6 +159,8 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void deleteProcessItemsForDeletedProcess() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
@@ -169,12 +176,13 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
.stackTraceIs(RestErrorModel.STACKTRACE);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
|
||||
description = "Delete process item by inexistent user.")
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL })
|
||||
public void deleteProcessItemByInexistentUser() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
@@ -195,6 +203,9 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
expectedExceptions = EmptyRestModelCollectionException.class)
|
||||
public void deleteProcessItemsForProcessWithoutItems() throws Exception
|
||||
{
|
||||
processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI()
|
||||
.addProcess("activitiAdhoc", assignee, false, Priority.Normal);
|
||||
|
||||
items = restClient.withWorkflowAPI().usingProcess(processModel).getProcessItems();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
items.assertThat().entriesListIsEmpty();
|
||||
@@ -208,17 +219,14 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.FULL, TestGroup.NETWORKS })
|
||||
public void deleteProcessItemByAdminSameNetwork() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser);
|
||||
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, CMISUtil.Priority.Normal);
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(tenantUserAssignee);
|
||||
|
||||
processModel = restClient.withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
@@ -236,17 +244,15 @@ public class DeleteProcessItemFullTests extends RestTest
|
||||
{
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
restClient.authenticateUser(adminUser).usingTenant().createTenant(adminTenantUser);
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
adminTenantUser2 = UserModel.getAdminTenantUser();
|
||||
restClient.usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
restClient.authenticateUser(dataUser.getAdminUser()).usingTenant().createTenant(adminTenantUser2);
|
||||
|
||||
processModel = restClient.authenticateUser(tenantUser).withWorkflowAPI().addProcess("activitiAdhoc", tenantUserAssignee, false, CMISUtil.Priority.Normal);
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(document)
|
||||
.createNewTaskAndAssignTo(tenantUserAssignee);
|
||||
|
||||
processModel = restClient.withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
document = dataContent.usingUser(adminTenantUser).usingSite(siteModel).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
|
||||
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user