added getProcessDefinitionById and updated getProcessDefinitionImage

(cherry picked from commit fa9a326)
This commit is contained in:
cagache
2017-03-06 13:16:12 +02:00
parent 547f356504
commit fb2cde04e2
4 changed files with 14 additions and 12 deletions
@@ -50,7 +50,7 @@ public class DeleteDeploymentSanityTests extends RestTest
deployment = allDeployments.getDeploymentByName("customWorkflowExtentionForRest.bpmn");
RestProcessDefinitionModel processDefinitionAssociated =
restClient.withWorkflowAPI().getAllProcessDefinitions().getProcessDefinitionByDeploymentId(deployment.getId());
restClient.withWorkflowAPI().getAllProcessDefinitions().getProcessDefinitionById(deployment.getId());
RestProcessModel addedProcess =
restClient.withWorkflowAPI().addProcess(processDefinitionAssociated.getName(), adminUser, false, CMISUtil.Priority.Normal);
@@ -33,8 +33,9 @@ public class GetProcessDefinitionImageCoreTests extends RestTest
public void getProcessDefinitionImageUsingInvalidProcessDefinitionId() throws Exception
{
restClient.authenticateUser(adminUser);
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry();
randomProcessDefinition.onModel().setId("invalidID");
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
randomProcessDefinition.setId("invalidID");
restClient.withWorkflowAPI()
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage();
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
@@ -47,23 +48,24 @@ public class GetProcessDefinitionImageCoreTests extends RestTest
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
executionType = ExecutionType.REGRESSION,
description = "Verify network admin is able to get a process definition image using REST API and status code is OK (200)")
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.CORE, TestGroup.NETWORKS })
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.CORE, TestGroup.NETWORKS})
@Bug(id = "MNT-17243")
public void networkAdminGetProcessDefinitionImage() throws Exception
{
adminTenantUser = UserModel.getAdminTenantUser();
restClient.authenticateUser(adminUser)
.usingTenant().createTenant(adminTenantUser);
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry();
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
restClient.withWorkflowAPI().usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage()
.assertResponseContainsImage();
restClient.assertStatusCodeIs(HttpStatus.OK);
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION },
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESS_DEFINITION },
executionType = ExecutionType.REGRESSION,
description = "Verify network user is able to get a process definition image using REST API and status code is OK (200)")
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.CORE, TestGroup.NETWORKS })
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION, TestGroup.CORE, TestGroup.NETWORKS})
@Bug(id = "MNT-17243")
public void networkUserGetProcessDefinitionImage() throws Exception
{
@@ -72,7 +74,7 @@ public class GetProcessDefinitionImageCoreTests extends RestTest
.usingTenant().createTenant(adminTenantUser);
UserModel tenantUser = dataUser.usingUser(adminTenantUser).createUserWithTenant("uTenant");
randomProcessDefinition = restClient.authenticateUser(adminTenantUser).withWorkflowAPI()
.getAllProcessDefinitions().getOneRandomEntry();
.getAllProcessDefinitions().getOneRandomEntry().onModel();
restClient.authenticateUser(tenantUser).withWorkflowAPI()
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage()
.assertResponseContainsImage();
@@ -34,8 +34,8 @@ public class GetProcessDefinitionImageFullTests extends RestTest
public void getProcessDefinitionImageUsingEmptyProcessDefinitionId() throws Exception
{
restClient.authenticateUser(adminUser);
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry();
randomProcessDefinition.onModel().setId("");
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
randomProcessDefinition.setId("");
restClient.withWorkflowAPI()
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage();
restClient.assertStatusCodeIs(HttpStatus.BAD_REQUEST);
@@ -53,7 +53,7 @@ public class GetProcessDefinitionImageFullTests extends RestTest
restClient.usingTenant().createTenant(adminTenantUser2);
RestProcessDefinitionModel randomProcessDefinition = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI()
.getAllProcessDefinitions().getOneRandomEntry();
.getAllProcessDefinitions().getOneRandomEntry().onModel();
restClient.authenticateUser(adminTenantUser2).withWorkflowAPI()
.usingProcessDefinitions(randomProcessDefinition).getProcessDefinitionImage();
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND)
@@ -23,7 +23,7 @@ public class GetProcessDefinitionImageSanityTests extends RestTest
{
testUser = dataUser.createRandomTestUser();
restClient.authenticateUser(dataUser.getAdminUser());
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry();
randomProcessDefinition = restClient.withWorkflowAPI().getAllProcessDefinitions().getOneRandomEntry().onModel();
}
@TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESS_DEFINITION }, executionType = ExecutionType.SANITY,