mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Merge branch 'TAS-1952' of https://gitlab.alfresco.com/tas/alfresco-tas-restapi-test into 5.1.N-newDSL
# Conflicts: # src/test/java/org/alfresco/rest/workflow/tasks/GetTasksSanityTests.java
This commit is contained in:
@@ -3,10 +3,7 @@ package org.alfresco.rest;
|
||||
import org.alfresco.rest.core.RestProperties;
|
||||
import org.alfresco.rest.core.RestWrapper;
|
||||
import org.alfresco.utility.TasProperties;
|
||||
import org.alfresco.utility.data.DataContent;
|
||||
import org.alfresco.utility.data.DataGroup;
|
||||
import org.alfresco.utility.data.DataSite;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.data.*;
|
||||
import org.alfresco.utility.network.ServerHealth;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -40,6 +37,9 @@ public abstract class RestTest extends AbstractTestNGSpringContextTests
|
||||
@Autowired
|
||||
protected DataGroup dataGroup;
|
||||
|
||||
@Autowired
|
||||
protected DataWorkflow dataWorkflow;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void checkServerHealth() throws Exception
|
||||
{
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package org.alfresco.rest;
|
||||
|
||||
import org.alfresco.utility.data.DataWorkflow;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
public abstract class RestWorkflowTest extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
protected DataWorkflow dataWorkflow;
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processDefinitions;
|
||||
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/13/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY })
|
||||
public class GetProcessDefinitionImageSanityTests extends RestWorkflowTest
|
||||
public class GetProcessDefinitionImageSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
private DataUser dataUser;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processDefinitions;
|
||||
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/13/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY })
|
||||
public class GetProcessDefinitionSanityTests extends RestWorkflowTest
|
||||
public class GetProcessDefinitionSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
private DataUser dataUser;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processDefinitions;
|
||||
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessDefinitionModel;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/18/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY })
|
||||
public class GetProcessDefinitionStartFormModelSanityTests extends RestWorkflowTest
|
||||
public class GetProcessDefinitionStartFormModelSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
private DataUser dataUser;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package org.alfresco.rest.workflow.processDefinitions;
|
||||
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
@@ -15,7 +15,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/13/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.SANITY })
|
||||
public class GetProcessDefinitionsSanityTests extends RestWorkflowTest
|
||||
public class GetProcessDefinitionsSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
private DataUser dataUser;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
@@ -21,7 +21,7 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY})
|
||||
public class AddProcessItemSanityTests extends RestWorkflowTest
|
||||
public class AddProcessItemSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document, document2;
|
||||
private SiteModel siteModel;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessModelsCollection;
|
||||
@@ -16,7 +16,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/18/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class AddProcessSanityTests extends RestWorkflowTest
|
||||
public class AddProcessSanityTests extends RestTest
|
||||
{
|
||||
private UserModel userWhoStartsProcess, assignee;
|
||||
private UserModel adminTenantUser, tenantUserWhoStartsProcess, tenantAssignee;
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessVariableModel;
|
||||
import org.alfresco.utility.data.RandomData;
|
||||
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class AddProcessVariableSanityTests extends RestWorkflowTest
|
||||
public class AddProcessVariableSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -18,7 +18,7 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class DeleteProcessItemSanityTests extends RestWorkflowTest
|
||||
public class DeleteProcessItemSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document, document2;
|
||||
private SiteModel siteModel;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
@@ -15,7 +15,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/12/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class DeleteProcessSanityTests extends RestWorkflowTest
|
||||
public class DeleteProcessSanityTests extends RestTest
|
||||
{
|
||||
private UserModel userWhoAddsProcess, assignee, anotherUser;
|
||||
private RestProcessModel process;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessVariableModel;
|
||||
import org.alfresco.utility.model.*;
|
||||
@@ -15,7 +15,7 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class DeleteProcessVariableSanityTests extends RestWorkflowTest
|
||||
public class DeleteProcessVariableSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
|
||||
@@ -2,7 +2,7 @@ package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.dataprep.CMISUtil.Priority;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestItemModelsCollection;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
|
||||
*/
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class GetProcessItemsSanityTests extends RestWorkflowTest
|
||||
public class GetProcessItemsSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
@@ -15,7 +15,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/19/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class GetProcessSanityTests extends RestWorkflowTest
|
||||
public class GetProcessSanityTests extends RestTest
|
||||
{
|
||||
private UserModel userWhoStartsProcess, assignee;
|
||||
private RestProcessModel addedProcess, process;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestTaskModelsCollection;
|
||||
import org.alfresco.utility.model.*;
|
||||
@@ -17,7 +17,7 @@ import org.testng.annotations.Test;
|
||||
* @author Cristina Axinte
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class GetProcessTasksSanityTests extends RestWorkflowTest
|
||||
public class GetProcessTasksSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessVariableCollection;
|
||||
@@ -19,7 +19,7 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class GetProcessVariablesSanityTests extends RestWorkflowTest
|
||||
public class GetProcessVariablesSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModelsCollection;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
@@ -14,7 +14,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/11/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class GetProcessesSanityTests extends RestWorkflowTest
|
||||
public class GetProcessesSanityTests extends RestTest
|
||||
{
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
|
||||
+37
-47
@@ -2,19 +2,13 @@ package org.alfresco.rest.workflow.processes;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestProcessModel;
|
||||
import org.alfresco.rest.model.RestProcessVariableCollection;
|
||||
import org.alfresco.rest.model.RestProcessVariableModel;
|
||||
import org.alfresco.rest.requests.Processes;
|
||||
import org.alfresco.utility.data.DataUser;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TestGroup;
|
||||
import org.alfresco.utility.model.UserModel;
|
||||
import org.alfresco.utility.model.*;
|
||||
import org.alfresco.utility.testrail.ExecutionType;
|
||||
import org.alfresco.utility.testrail.annotation.TestRail;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
@@ -23,19 +17,14 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.SANITY })
|
||||
public class UpdateProcessVariableSanityTests extends RestWorkflowTest
|
||||
public class UpdateProcessVariableSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
private DataUser dataUser;
|
||||
|
||||
@Autowired
|
||||
private Processes processesApi;
|
||||
|
||||
private FileModel document;
|
||||
private SiteModel siteModel;
|
||||
private UserModel userWhoStartsTask, assignee;
|
||||
private UserModel userWhoStartsTask, assignee, adminUser;
|
||||
private RestProcessModel processModel;
|
||||
private UserModel adminUser;
|
||||
private RestProcessVariableCollection variables;
|
||||
private RestProcessVariableModel variableModel, updatedVariable;
|
||||
|
||||
@BeforeClass(alwaysRun = true)
|
||||
public void dataPreparation() throws Exception
|
||||
@@ -46,43 +35,44 @@ public class UpdateProcessVariableSanityTests extends RestWorkflowTest
|
||||
siteModel = dataSite.usingUser(userWhoStartsTask).createPublicRandomSite();
|
||||
document = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
|
||||
dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(assignee);
|
||||
processesApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = {"rest-api", TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Create non-existing variable using put call")
|
||||
public void addProcessVariable() throws JsonToModelConversionException, Exception
|
||||
public void addProcessVariable() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
RestProcessVariableModel variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = processesApi.addProcess("activitiAdhoc", adminUser, false, CMISUtil.Priority.Normal);
|
||||
processesApi.updateProcessVariable(processModel, variableModel);
|
||||
processesApi.getProcessesVariables(processModel).assertThat().entriesListContains("name", variableModel.getName());
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminUser).withWorkflowAPI().addProcess("activitiAdhoc", adminUser, false, CMISUtil.Priority.Normal);
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).updateProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
variables = restClient.withWorkflowAPI().usingProcess(processModel).getProcessVariables();
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
variables.assertThat().entriesListContains("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = {"rest-api", TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Update existing variable using put call")
|
||||
public void updateProcessVariable() throws JsonToModelConversionException, Exception
|
||||
public void updateProcessVariable() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
RestProcessVariableModel variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = processesApi.getProcesses().getOneRandomEntry();
|
||||
processesApi.addProcessVariable(processModel, variableModel);
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).addProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.CREATED);
|
||||
variableModel.setValue("newValue");
|
||||
processesApi.updateProcessVariable(processModel, variableModel).assertThat().field("value").is("newValue");
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
updatedVariable = restClient.withWorkflowAPI().usingProcess(processModel).updateProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
updatedVariable.assertThat().field("value").is("newValue");
|
||||
}
|
||||
|
||||
@TestRail(section = {"rest-api", TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Try to add process variable using an invalid processId")
|
||||
public void addProcessVariableUsingInvalidProcessId() throws JsonToModelConversionException, Exception
|
||||
public void addProcessVariableUsingInvalidProcessId() throws Exception
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
RestProcessVariableModel variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = processesApi.getProcesses().getOneRandomEntry();
|
||||
processModel.onModel().setId("abc");
|
||||
processesApi.updateProcessVariable(processModel, variableModel);
|
||||
processesApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text");
|
||||
processModel = restClient.authenticateUser(adminUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
|
||||
processModel.setId("abc");
|
||||
restClient.withWorkflowAPI().usingProcess(processModel).updateProcessVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
|
||||
.assertLastError().containsSummary(String.format(ErrorModel.ENTITY_NOT_FOUND, "abc"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.exception.JsonToModelConversionException;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
@@ -20,7 +20,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
public class AddTaskItemSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
@@ -48,7 +48,7 @@ public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Create non-existing task item")
|
||||
public void createTaskItem() throws Exception
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
restClient.authenticateUser(adminUser);
|
||||
document2 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document2);
|
||||
|
||||
|
||||
taskItem.assertThat().field("createdAt").is(taskItem.getCreatedAt())
|
||||
.assertThat().field("size").is(taskItem.getSize())
|
||||
.assertThat().field("createdBy").is(taskItem.getCreatedBy())
|
||||
@@ -67,9 +67,9 @@ public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
.assertThat().field("mimeType").is(taskItem.getMimeType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
||||
@Bug(id = "MNT-16966")
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that in case task item exists request ")
|
||||
public void createTaskItemThatAlreadyExists() throws Exception
|
||||
{
|
||||
@@ -88,27 +88,27 @@ public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document3);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
@Test(groups = { TestGroup.NETWORKS })
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.PROCESSES }, executionType = ExecutionType.SANITY,
|
||||
description = "Add task item using admin user from same network")
|
||||
public void addTaskItemByAdminSameNetwork() throws JsonToModelConversionException, Exception
|
||||
{
|
||||
UserModel adminuser = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminuser);
|
||||
|
||||
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
tenantApi.useRestClient(restClient);
|
||||
tenantApi.createTenant(adminTenantUser);
|
||||
|
||||
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(tenantUserAssignee);
|
||||
|
||||
|
||||
document4 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document4);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document4);
|
||||
taskItem.assertThat().field("createdAt").is(taskItem.getCreatedAt())
|
||||
.and().field("size").is(taskItem.getSize())
|
||||
.and().field("createdBy").is(taskItem.getCreatedBy())
|
||||
@@ -116,7 +116,7 @@ public class AddTaskItemSanityTests extends RestWorkflowTest
|
||||
.and().field("name").is(taskItem.getName())
|
||||
.and().field("modifiedBy").is(taskItem.getModifiedBy())
|
||||
.and().field("id").is(taskItem.getId())
|
||||
.and().field("mimeType").is(taskItem.getMimeType());
|
||||
.and().field("mimeType").is(taskItem.getMimeType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -20,13 +20,13 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
public class AddTaskVariablesSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
|
||||
|
||||
private UserModel userModel, userWhoStartsTask;
|
||||
private SiteModel siteModel;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel;
|
||||
private UserModel assigneeUser;
|
||||
private TaskModel taskModel;
|
||||
@@ -44,7 +44,7 @@ public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Create non-existing task variable with admin")
|
||||
public void createTaskVariableWithAdmin() throws Exception
|
||||
{
|
||||
@@ -59,8 +59,8 @@ public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
.and().field("type").is(variableModel.getType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Create non-existing task variable with user involved in the process")
|
||||
public void createTaskVariableWithInvolvedUser() throws Exception
|
||||
{
|
||||
@@ -71,11 +71,11 @@ public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
.and().field("name").is(variableModel.getName())
|
||||
.and().field("value").is(variableModel.getValue())
|
||||
.and().field("type").is(variableModel.getType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
tasksApi.getTaskVariables(taskModel).assertThat().entriesListContains("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Create non-existing task variable with task owner")
|
||||
public void createTaskVariableWithTaskOwner() throws Exception
|
||||
{
|
||||
@@ -88,8 +88,8 @@ public class AddTaskVariablesSanityTests extends RestWorkflowTest
|
||||
.and().field("type").is(variableModel.getType());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Create non-existing task variable with any user")
|
||||
public void createTaskVariableWithRandomUser() throws Exception
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -20,13 +20,13 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class DeleteTaskVariableSanityTests extends RestWorkflowTest
|
||||
public class DeleteTaskVariableSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
|
||||
|
||||
private UserModel userModel, adminUser;
|
||||
private SiteModel siteModel;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel;
|
||||
private UserModel assigneeUser;
|
||||
private TaskModel taskModel;
|
||||
@@ -44,7 +44,7 @@ public class DeleteTaskVariableSanityTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Delete existing task variable")
|
||||
public void deleteTaskVariable() throws Exception
|
||||
{
|
||||
@@ -55,8 +55,8 @@ public class DeleteTaskVariableSanityTests extends RestWorkflowTest
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
tasksApi.getTaskVariables(taskModel).assertThat().entriesListDoesNotContain("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Try to delete existing task variable using invalid task id")
|
||||
public void tryToDeleteTaskVariableUsingInvalidTaskId() throws Exception
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
@@ -17,16 +17,16 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Cristina Axinte
|
||||
*
|
||||
*/
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class GetTaskCandidatesTests extends RestWorkflowTest
|
||||
public class GetTaskCandidatesTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
|
||||
|
||||
private UserModel userModel, user, userModel1, userModel2;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel;
|
||||
@@ -48,32 +48,32 @@ public class GetTaskCandidatesTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that admin gets task candidates")
|
||||
public void getTaskCandidatesByAdmin() throws Exception
|
||||
{
|
||||
{
|
||||
restClient.authenticateUser(dataUser.getAdminUser());
|
||||
tasksApi.getTaskCandidates(taskModel)
|
||||
.assertThat().entriesListContains("candidateType", "group")
|
||||
.and().entriesListContains("candidateId", String.format("GROUP_%s", group.getGroupIdentifier()));
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that started the process gets task candidates")
|
||||
public void getTaskCandidatesByUserWhoStartedProcess() throws Exception
|
||||
{
|
||||
{
|
||||
restClient.authenticateUser(user);
|
||||
tasksApi.getTaskCandidates(taskModel)
|
||||
.assertThat().entriesListContains("candidateType", "group")
|
||||
.and().entriesListContains("candidateId", String.format("GROUP_%s", group.getGroupIdentifier()));
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user from the assighed group to the process gets task candidates")
|
||||
public void getTaskCandidatesByCandidateUser() throws Exception
|
||||
{
|
||||
{
|
||||
restClient.authenticateUser(userModel1);
|
||||
tasksApi.getTaskCandidates(taskModel)
|
||||
.assertThat().entriesListContains("candidateType", "group")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestFormModelsCollection;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -20,7 +20,7 @@ import org.testng.annotations.Test;
|
||||
* Created by Claudia Agache on 10/20/2016.
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class GetTaskFormModelSanityTests extends RestWorkflowTest
|
||||
public class GetTaskFormModelSanityTests extends RestTest
|
||||
{
|
||||
@Autowired RestTasksApi tasksApi;
|
||||
|
||||
@@ -46,12 +46,12 @@ public class GetTaskFormModelSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(dataUser.getAdminUser());
|
||||
RestFormModelsCollection returnedCollection = tasksApi.getTaskFormModel(taskModel);
|
||||
|
||||
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty();
|
||||
|
||||
|
||||
String[] qualifiedNames = {
|
||||
"{http://www.alfresco.org/model/bpm/1.0}percentComplete",
|
||||
"{http://www.alfresco.org/model/bpm/1.0}percentComplete",
|
||||
"{http://www.alfresco.org/model/bpm/1.0}context",
|
||||
"{http://www.alfresco.org/model/bpm/1.0}completedItems",
|
||||
"{http://www.alfresco.org/model/content/1.0}name",
|
||||
@@ -62,12 +62,12 @@ public class GetTaskFormModelSanityTests extends RestWorkflowTest
|
||||
"{http://www.alfresco.org/model/bpm/1.0}taskId",
|
||||
"{http://www.alfresco.org/model/bpm/1.0}packageItemActionGroup",
|
||||
"{http://www.alfresco.org/model/bpm/1.0}completionDate"};
|
||||
|
||||
|
||||
for(String formQualifiedName : qualifiedNames)
|
||||
{
|
||||
returnedCollection.assertThat().entriesListContains("qualifiedName", formQualifiedName);
|
||||
}
|
||||
|
||||
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class GetTaskFormModelSanityTests extends RestWorkflowTest
|
||||
{
|
||||
restClient.authenticateUser(userModel);
|
||||
RestFormModelsCollection returnedCollection = tasksApi.getTaskFormModel(taskModel);
|
||||
|
||||
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
returnedCollection.assertThat().entriesListIsNotEmpty();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.rest.requests.RestTenantApi;
|
||||
@@ -19,14 +19,14 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
public class GetTaskItemsSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
|
||||
@Autowired
|
||||
RestTenantApi tenantApi;
|
||||
|
||||
|
||||
private UserModel userModel, userWhoStartsTask, assignee, adminTenantUser, tenantUser, tenantUserAssignee;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel, document1;
|
||||
@@ -45,7 +45,7 @@ public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that started the process gets task items")
|
||||
public void getTaskItemsByUserWhoStartedProcess() throws Exception
|
||||
{
|
||||
@@ -60,8 +60,8 @@ public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that involved user in process gets task items")
|
||||
public void getTaskItemsByUserInvolvedInProcess() throws Exception
|
||||
{
|
||||
@@ -74,8 +74,8 @@ public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
.entriesListContains("name", document1.getName());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that started the process gets task items")
|
||||
@Test(groups = { TestGroup.NETWORKS })
|
||||
public void getTaskItemsByAdminInSameNetwork() throws Exception
|
||||
@@ -86,13 +86,13 @@ public class GetTaskItemsSanityTests extends RestWorkflowTest
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
tenantApi.useRestClient(restClient);
|
||||
tenantApi.createTenant(adminTenantUser);
|
||||
|
||||
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(tenantUserAssignee);
|
||||
|
||||
|
||||
document1 = dataContent.usingSite(siteModel).createContent(DocumentType.XML);
|
||||
taskItem = tasksApi.addTaskItem(taskModel, document1);
|
||||
tasksApi.getTaskItems(taskModel).assertThat()
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
@@ -18,7 +17,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class GetTaskSanityTests extends RestWorkflowTest
|
||||
public class GetTaskSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
@@ -52,7 +51,7 @@ public class GetTaskSanityTests extends RestWorkflowTest
|
||||
.and().field("message").is(taskModel.getMessage());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify assignee user gets its assigned task with Rest API and response is successfull (200)")
|
||||
public void assigneeUserGetsItsTaskWithSuccess() throws Exception
|
||||
{
|
||||
@@ -62,7 +61,7 @@ public class GetTaskSanityTests extends RestWorkflowTest
|
||||
.and().field("message").is(taskModel.getMessage());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify user that started the task gets the started task with Rest API and response is successfull (200)")
|
||||
public void starterUserGetsItsTaskWithSuccess() throws Exception
|
||||
{
|
||||
@@ -72,17 +71,17 @@ public class GetTaskSanityTests extends RestWorkflowTest
|
||||
.and().field("message").is(taskModel.getMessage());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify any user with no relation to task id forbidden to get other task with Rest API (403)")
|
||||
public void anyUserIsForbiddenToGetOtherTask() throws Exception
|
||||
{
|
||||
UserModel anyUser= dataUser.createRandomTestUser();
|
||||
|
||||
|
||||
restClient.authenticateUser(anyUser);
|
||||
tasksApi.getTask(taskModel);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary("Permission was denied");
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify candidate user gets its specific task and no other user claimed the task with Rest API and response is successfull (200)")
|
||||
public void candidateUserGetsItsTasks() throws Exception
|
||||
{
|
||||
@@ -91,14 +90,14 @@ public class GetTaskSanityTests extends RestWorkflowTest
|
||||
GroupModel group = dataGroup.createRandomGroup();
|
||||
dataGroup.addListOfUsersToGroup(group, userModel1, userModel2);
|
||||
TaskModel taskModel = dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createPooledReviewTaskAndAssignTo(group);
|
||||
|
||||
|
||||
restClient.authenticateUser(userModel1);
|
||||
tasksApi.getTask(taskModel)
|
||||
.assertThat().field("id").is(taskModel.getId())
|
||||
.and().field("message").is(taskModel.getMessage());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@Bug(id = "MNT-17051")
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify involved user in a task without claim it gets the task with Rest API and response is successfull (200)")
|
||||
public void involvedUserWithoutClaimTaskGetsTask() throws Exception
|
||||
@@ -109,7 +108,7 @@ public class GetTaskSanityTests extends RestWorkflowTest
|
||||
dataGroup.addListOfUsersToGroup(group, userModel1, userModel2);
|
||||
TaskModel taskModel = dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createPooledReviewTaskAndAssignTo(group);
|
||||
dataWorkflow.usingUser(userModel1).claimTask(taskModel);
|
||||
|
||||
|
||||
restClient.authenticateUser(userModel2);
|
||||
tasksApi.getTask(taskModel)
|
||||
.assertThat().field("id").is(taskModel.getId())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
@@ -19,7 +19,7 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class GetTaskVariablesSanityTests extends RestWorkflowTest
|
||||
public class GetTaskVariablesSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
@@ -42,7 +42,7 @@ public class GetTaskVariablesSanityTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that started the process gets task variables")
|
||||
public void getTaskVariablesByUserWhoStartedProcess() throws Exception
|
||||
{
|
||||
@@ -50,8 +50,8 @@ public class GetTaskVariablesSanityTests extends RestWorkflowTest
|
||||
tasksApi.getTaskVariables(taskModel).assertThat().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that is involved in the process gets task variables")
|
||||
public void getTaskVariablesByUserInvolvedInProcess() throws Exception
|
||||
{
|
||||
@@ -59,24 +59,24 @@ public class GetTaskVariablesSanityTests extends RestWorkflowTest
|
||||
tasksApi.getTaskVariables(taskModel).assertThat().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that user that is not involved in the process gets task variables")
|
||||
public void getTaskVariablesUsingAnyUser() throws Exception
|
||||
{
|
||||
UserModel randomUser = dataUser.createRandomTestUser();
|
||||
|
||||
|
||||
restClient.authenticateUser(randomUser);
|
||||
tasksApi.getTaskVariables(taskModel);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary("Permission was denied");
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Verify that admin gets task variables")
|
||||
public void getTaskVariablesUsingAdmin() throws Exception
|
||||
{
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
|
||||
|
||||
restClient.authenticateUser(adminUser);
|
||||
tasksApi.getTaskVariables(taskModel).assertThat().entriesListIsNotEmpty();
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestTaskModelsCollection;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
@@ -19,14 +19,14 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class GetTasksSanityTests extends RestWorkflowTest
|
||||
public class GetTasksSanityTests extends RestTest
|
||||
{
|
||||
UserModel userModel;
|
||||
SiteModel siteModel;
|
||||
UserModel candidateUser;
|
||||
FileModel fileModel;
|
||||
UserModel assigneeUser;
|
||||
RestTaskModelsCollection taskModels;
|
||||
RestTaskModelsCollection taskModels;
|
||||
|
||||
@BeforeClass(alwaysRun=true)
|
||||
public void dataPreparation() throws Exception
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestItemModel;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -20,14 +20,14 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class RemoveTaskItemSanityTests extends RestWorkflowTest
|
||||
public class RemoveTaskItemSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
|
||||
|
||||
|
||||
|
||||
private UserModel adminUser, userModel, userWhoStartsTask, assigneeUser;
|
||||
private SiteModel siteModel;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel, document2;
|
||||
private TaskModel taskModel;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class RemoveTaskItemSanityTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Delete existing task item")
|
||||
public void deleteTaskItem() throws Exception
|
||||
{
|
||||
@@ -60,8 +60,8 @@ public class RemoveTaskItemSanityTests extends RestWorkflowTest
|
||||
.assertThat().entriesListDoesNotContain("id", taskItem.getId()).and()
|
||||
.entriesListDoesNotContain("name", document2.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Try to Delete existing task item using invalid taskId")
|
||||
public void deleteTaskItemUsingInvalidTaskId() throws Exception
|
||||
{
|
||||
@@ -72,8 +72,8 @@ public class RemoveTaskItemSanityTests extends RestWorkflowTest
|
||||
tasksApi.deleteTaskItem(taskModel, taskItem);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Try to Delete existing task item using invalid itemId")
|
||||
public void deleteTaskItemUsingInvalidItemId() throws Exception
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.rest.requests.RestTenantApi;
|
||||
@@ -21,21 +21,21 @@ import org.testng.annotations.Test;
|
||||
* @author iulia.cojocea
|
||||
*/
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class UpdateTaskVariableSanityTests extends RestWorkflowTest
|
||||
public class UpdateTaskVariableSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
|
||||
|
||||
@Autowired
|
||||
RestTenantApi tenantApi;
|
||||
|
||||
|
||||
private UserModel userModel;
|
||||
private SiteModel siteModel;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel;
|
||||
private UserModel assigneeUser;
|
||||
private TaskModel taskModel, tenantTask;
|
||||
|
||||
|
||||
|
||||
private UserModel adminTenantUser, tenantUser, tenantUserAssignee;
|
||||
|
||||
private RestVariableModel taskVariable;
|
||||
@@ -52,7 +52,7 @@ public class UpdateTaskVariableSanityTests extends RestWorkflowTest
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Create non-existing task variable")
|
||||
public void createTaskVariable() throws Exception
|
||||
{
|
||||
@@ -66,8 +66,8 @@ public class UpdateTaskVariableSanityTests extends RestWorkflowTest
|
||||
.and().field("value").is(taskVariable.getValue());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Update existing task variable")
|
||||
public void updateTaskVariable() throws Exception
|
||||
{
|
||||
@@ -83,33 +83,33 @@ public class UpdateTaskVariableSanityTests extends RestWorkflowTest
|
||||
taskVariable = tasksApi.updateTaskVariable(taskModel, variableModel).and().field("value").is("updatedValue");
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@Test(groups = {TestGroup.NETWORKS })
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
description = "Update existing task variable by admin in the same network")
|
||||
public void updateTaskVariableByAdminInSameNetwork() throws Exception
|
||||
{
|
||||
UserModel adminUser = dataUser.getAdminUser();
|
||||
restClient.authenticateUser(adminUser);
|
||||
|
||||
|
||||
adminTenantUser = UserModel.getAdminTenantUser();
|
||||
tenantApi.useRestClient(restClient);
|
||||
tenantApi.createTenant(adminTenantUser);
|
||||
|
||||
|
||||
tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
|
||||
tenantUserAssignee = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenantAssignee");
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
|
||||
siteModel = dataSite.usingUser(adminTenantUser).createPublicRandomSite();
|
||||
tenantTask = dataWorkflow.usingUser(tenantUser).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(tenantUserAssignee);
|
||||
|
||||
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
taskVariable = tasksApi.updateTaskVariable(tenantTask, variableModel);
|
||||
|
||||
|
||||
taskVariable.assertThat().field("scope").is(taskVariable.getScope())
|
||||
.and().field("name").is(taskVariable.getName())
|
||||
.and().field("type").is(taskVariable.getType())
|
||||
.and().field("value").is(taskVariable.getValue());
|
||||
|
||||
.and().field("value").is(taskVariable.getValue());
|
||||
|
||||
variableModel.setValue("updatedValue");
|
||||
taskVariable = tasksApi.updateTaskVariable(taskModel, variableModel).and().field("value").is("updatedValue");
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.alfresco.rest.workflow.tasks;
|
||||
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestWorkflowTest;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.GroupModel;
|
||||
@@ -17,7 +17,7 @@ import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class UploadTaskSanityTests extends RestWorkflowTest
|
||||
public class UploadTaskSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
@@ -28,7 +28,7 @@ public class UploadTaskSanityTests extends RestWorkflowTest
|
||||
FileModel fileModel;
|
||||
UserModel assigneeUser;
|
||||
TaskModel taskModel;
|
||||
|
||||
|
||||
@BeforeClass(alwaysRun=true)
|
||||
public void dataPreparation() throws Exception
|
||||
{
|
||||
@@ -40,7 +40,7 @@ public class UploadTaskSanityTests extends RestWorkflowTest
|
||||
|
||||
tasksApi.useRestClient(restClient);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify admin user updates task with Rest API and response is successfull (200)")
|
||||
public void adminUserUpdatesAnyTaskWithSuccess() throws Exception
|
||||
{
|
||||
@@ -51,7 +51,7 @@ public class UploadTaskSanityTests extends RestWorkflowTest
|
||||
.and().field("message").is(taskModel.getMessage());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify assignee user updates its assigned task with Rest API and response is successfull (200)")
|
||||
public void assigneeUserUpdatesItsTaskWithSuccess() throws Exception
|
||||
{
|
||||
@@ -61,7 +61,7 @@ public class UploadTaskSanityTests extends RestWorkflowTest
|
||||
.and().field("message").is(taskModel.getMessage());
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify user that started the task updates the started task with Rest API and response is successfull (200)")
|
||||
public void starterUserUpdatesItsTaskWithSuccess() throws Exception
|
||||
{
|
||||
@@ -69,17 +69,17 @@ public class UploadTaskSanityTests extends RestWorkflowTest
|
||||
tasksApi.updateTask(taskModel);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify any user with no relation to task is forbidden to update other task with Rest API (403)")
|
||||
public void anyUserIsForbiddenToUpdateOtherTask() throws Exception
|
||||
{
|
||||
UserModel anyUser= dataUser.createRandomTestUser();
|
||||
|
||||
|
||||
restClient.authenticateUser(anyUser);
|
||||
tasksApi.updateTask(taskModel);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.FORBIDDEN).assertLastError().containsSummary("Permission was denied");
|
||||
}
|
||||
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY, description = "Verify candidate user updates its specific task and no other user claimed the task with Rest API and response is successfull (200)")
|
||||
public void candidateUserUpdatesItsTasks() throws Exception
|
||||
{
|
||||
@@ -88,7 +88,7 @@ public class UploadTaskSanityTests extends RestWorkflowTest
|
||||
GroupModel group = dataGroup.createRandomGroup();
|
||||
dataGroup.addListOfUsersToGroup(group, userModel1, userModel2);
|
||||
TaskModel taskModel = dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createPooledReviewTaskAndAssignTo(group);
|
||||
|
||||
|
||||
restClient.authenticateUser(userModel1);
|
||||
tasksApi.updateTask(taskModel)
|
||||
.assertThat().field("id").is(taskModel.getId())
|
||||
|
||||
Reference in New Issue
Block a user