mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Refactor Test: DeleteTaskVariableSanityTests.java
This commit is contained in:
@@ -3,7 +3,6 @@ package org.alfresco.rest.workflow.tasks;
|
||||
import org.alfresco.dataprep.CMISUtil.DocumentType;
|
||||
import org.alfresco.rest.RestTest;
|
||||
import org.alfresco.rest.model.RestVariableModel;
|
||||
import org.alfresco.rest.requests.RestTasksApi;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
import org.alfresco.utility.model.SiteModel;
|
||||
import org.alfresco.utility.model.TaskModel;
|
||||
@@ -11,7 +10,6 @@ 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;
|
||||
@@ -22,9 +20,6 @@ import org.testng.annotations.Test;
|
||||
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.SANITY })
|
||||
public class DeleteTaskVariableSanityTests extends RestTest
|
||||
{
|
||||
@Autowired
|
||||
RestTasksApi tasksApi;
|
||||
|
||||
private UserModel userModel, adminUser;
|
||||
private SiteModel siteModel;
|
||||
private FileModel fileModel;
|
||||
@@ -40,8 +35,6 @@ public class DeleteTaskVariableSanityTests extends RestTest
|
||||
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,
|
||||
@@ -50,10 +43,12 @@ public class DeleteTaskVariableSanityTests extends RestTest
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
tasksApi.addTaskVariable(taskModel, variableModel);
|
||||
tasksApi.deleteTaskVariable(taskModel, variableModel);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
tasksApi.getTaskVariables(taskModel).assertThat().entriesListDoesNotContain("name", variableModel.getName());
|
||||
|
||||
restClient.withWorkflowAPI().usingTask(taskModel).addTaskVariable(variableModel);
|
||||
restClient.withWorkflowAPI().usingTask(taskModel).deleteTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);
|
||||
restClient.withWorkflowAPI().usingTask(taskModel).getTaskVariables()
|
||||
.assertThat().entriesListDoesNotContain("name", variableModel.getName());
|
||||
}
|
||||
|
||||
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.SANITY,
|
||||
@@ -62,9 +57,10 @@ public class DeleteTaskVariableSanityTests extends RestTest
|
||||
{
|
||||
restClient.authenticateUser(adminUser);
|
||||
RestVariableModel variableModel = RestVariableModel.getRandomTaskVariableModel("local", "d:text");
|
||||
tasksApi.updateTaskVariable(taskModel, variableModel);
|
||||
|
||||
restClient.withWorkflowAPI().usingTask(taskModel).updateTaskVariable(variableModel);
|
||||
taskModel.setId("incorrectTaskId");
|
||||
tasksApi.deleteTaskVariable(taskModel, variableModel);
|
||||
tasksApi.usingRestWrapper().assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
restClient.withWorkflowAPI().usingTask(taskModel).deleteTaskVariable(variableModel);
|
||||
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user