From 2a368b7116edf60984003951880e4772d97fee41 Mon Sep 17 00:00:00 2001 From: cagache Date: Tue, 31 Jan 2017 12:16:36 +0200 Subject: [PATCH] TAS - 2891 - getDeployments --- .../deployments/GetDeploymentsFullTests.java | 17 +++++++++++++++++ .../deployments/GetDeploymentsSanityTests.java | 3 +-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsFullTests.java b/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsFullTests.java index a62735f91..6080faa3b 100644 --- a/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsFullTests.java +++ b/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsFullTests.java @@ -143,4 +143,21 @@ public class GetDeploymentsFullTests extends RestTest .field("name").isNull(); } + @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS }, + executionType = ExecutionType.REGRESSION, + description = "Verify that network admin user is not able to get a deployment from other network using REST API and status code is OK (200)") + @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.DEPLOYMENTS, TestGroup.FULL, TestGroup.NETWORKS}) + public void adminDoesNotGetDeploymentsFromOtherNetwork() throws Exception + { + UserModel adminTenantUser1 = UserModel.getAdminTenantUser(); + UserModel adminTenantUser2 = UserModel.getAdminTenantUser(); + restClient.authenticateUser(adminUserModel).usingTenant().createTenant(adminTenantUser1); + restClient.usingTenant().createTenant(adminTenantUser2); + + RestDeploymentModel deployment = restClient.authenticateUser(adminTenantUser1).withWorkflowAPI().getDeployments().getOneRandomEntry().onModel(); + deployments = restClient.authenticateUser(adminTenantUser2).withWorkflowAPI().getDeployments(); + restClient.assertStatusCodeIs(HttpStatus.OK); + deployments.assertThat().entriesListDoesNotContain("id", deployment.getId()); + } + } diff --git a/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsSanityTests.java b/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsSanityTests.java index 1ee87f741..6eab0bae6 100644 --- a/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsSanityTests.java +++ b/e2e-test/java/org/alfresco/rest/workflow/deployments/GetDeploymentsSanityTests.java @@ -50,7 +50,6 @@ public class GetDeploymentsSanityTests extends RestTest restClient.usingTenant().createTenant(adminTenantUser); deployments = restClient.authenticateUser(adminTenantUser).withWorkflowAPI().getDeployments(); restClient.assertStatusCodeIs(HttpStatus.OK); - deployments.assertThat().entriesListIsNotEmpty() - .and().entriesListDoesNotContain("name", "customWorkflowExtentionForRest.bpmn"); + deployments.assertThat().entriesListIsNotEmpty(); } }