bug: fixed tests described in TAS-2887

This commit is contained in:
Alecsandru Prună
2017-01-27 10:54:29 +02:00
parent be2ca760a4
commit 1f52f58db6
2 changed files with 12 additions and 2 deletions
@@ -116,10 +116,11 @@ public class AddProcessItemCoreTests extends RestTest
public void failedAddingProcessItemIfInvalidProcessIdIsProvided() throws Exception
{
RestProcessModelsCollection processes = restClient.authenticateUser(adminUser).withParams("maxItems=1").withWorkflowAPI().getProcesses();
processModel= processes.assertThat().entriesListIsNotEmpty().when().getOneRandomEntry().onModel();
processModel = processes.assertThat().entriesListIsNotEmpty().when().getOneRandomEntry().onModel();
FileModel testDocument = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
processModel.setId("invalidProcessId");
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document);
processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(testDocument);
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError()
.containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidProcessId"));
}
@@ -106,6 +106,15 @@ public class GetProcessVariablesCoreTests extends RestTest
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.CORE })
public void getProcessVariablesForADeletedProcess() throws JsonToModelConversionException, Exception
{
SiteModel siteModel = dataSite.usingUser(userWhoStartsTask).createPublicRandomSite();
UserModel userWhoStartsTask = dataUser.createRandomTestUser();
UserModel assignee = dataUser.createRandomTestUser();
FileModel document = dataContent.usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN);
RestProcessModel processModel;
RestProcessVariableCollection variables;
dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(assignee);
processModel = restClient.authenticateUser(userWhoStartsTask).withParams("maxItems=2").withWorkflowAPI().getProcesses().getOneRandomEntry().onModel();
restClient.authenticateUser(admin).withWorkflowAPI().usingProcess(processModel).deleteProcess();
restClient.assertStatusCodeIs(HttpStatus.NO_CONTENT);