TAS-1563 updateTaskVariable, create non-existing variable, 201

This commit is contained in:
Iulia Nechita
2016-10-18 16:30:54 +03:00
parent 007d2f1605
commit 4ffc4278f5
@@ -0,0 +1,63 @@
package org.alfresco.rest.workflow.tasks;
import org.alfresco.dataprep.CMISUtil.DocumentType;
import org.alfresco.rest.RestWorkflowTest;
import org.alfresco.rest.model.RestVariableModel;
import org.alfresco.rest.requests.RestTasksApi;
import org.alfresco.rest.requests.RestTenantApi;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TaskModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
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;
/**
* @author iulia.cojocea
*/
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
public class UpdateTaskVariableSanityTests extends RestWorkflowTest
{
@Autowired
RestTasksApi tasksApi;
@Autowired
RestTenantApi tenantApi;
private UserModel userModel;
private SiteModel siteModel;
private FileModel fileModel;
private UserModel assigneeUser;
private TaskModel taskModel, tenantTask;
private UserModel adminTenantUser, tenantUser, tenantUserAssignee;
@BeforeClass(alwaysRun=true)
public void dataPreparation() throws Exception
{
userModel = dataUser.createRandomTestUser();
siteModel = dataSite.usingUser(userModel).createPublicRandomSite();
fileModel = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
assigneeUser = dataUser.createRandomTestUser();
taskModel = dataWorkflow.usingUser(userModel).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(assigneeUser);
tasksApi.useRestClient(restClient);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
description = "Create non-existing task variable")
public void createTaskVariable() throws Exception
{
UserModel adminUser = dataUser.getAdminUser();
restClient.authenticateUser(adminUser);
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
tasksApi.updateTaskVariable(taskModel, variableModel);
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.OK);
}
}