diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/favorites/GetFavoriteSiteTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/favorites/GetFavoriteSiteTests.java index 72e702ec88..14c7857810 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/favorites/GetFavoriteSiteTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/favorites/GetFavoriteSiteTests.java @@ -1,5 +1,7 @@ package org.alfresco.rest.favorites; +import java.util.UUID; + import org.alfresco.dataprep.CMISUtil; import org.alfresco.dataprep.SiteService; import org.alfresco.rest.RestTest; @@ -189,13 +191,13 @@ public class GetFavoriteSiteTests extends RestTest sites.assertThat().entriesListIsNotEmpty(); } - @Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION }) - @TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, - description = "Verify invalid request returns status 401 when user is empty") - public void getFavoriteSiteWithEmptyPersonId() throws Exception + @Test (groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION }) + @TestRail (section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, + description = "Verify invalid request returns status 401 when user does not exist") + public void getFavoriteSiteWithFictionalPersonId() { - UserModel emptyUser = new UserModel("", "password"); - restClient.authenticateUser(emptyUser).withCoreAPI().usingAuthUser().getFavoriteSite(siteModel1); + UserModel fictionalUser = new UserModel("FictionalUser" + UUID.randomUUID(), "password"); + restClient.authenticateUser(fictionalUser).withCoreAPI().usingAuthUser().getFavoriteSite(siteModel1); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED); } diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/containers/GetSiteContainerTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/containers/GetSiteContainerTests.java index fee1aef75d..581066503a 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/containers/GetSiteContainerTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/containers/GetSiteContainerTests.java @@ -211,30 +211,6 @@ public class GetSiteContainerTests extends RestTest .stackTraceIs(RestErrorModel.STACKTRACE); } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) - @TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION, - description= "Verify if get container request for empty siteId returns status code 404") - public void getContainerForEmptySiteId() throws Exception - { - restClient.authenticateUser(testUser) - .withCoreAPI().usingSite("").getSiteContainer(ContainerName.links.toString()); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsErrorKey(RestErrorModel.RELATIONSHIP_NOT_FOUND_ERRORKEY) - .containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, "", ContainerName.links.toString())) - .descriptionURLIs(RestErrorModel.RESTAPIEXPLORER) - .stackTraceIs(RestErrorModel.STACKTRACE); - } - - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) - @TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION, - description= "Verify if get container request for empty container returns status code 200 and the list of containers") - public void getContainerForEmptyContainer() throws Exception - { - restClient.authenticateUser(testUser) - .withCoreAPI().usingSite(moderatedSiteModel).getSiteContainer(""); - restClient.assertStatusCodeIs(HttpStatus.OK); - } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) @TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION, description= "Verify if get container with name containing special chars returns status code 404") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/GetSiteGroupTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/GetSiteGroupTests.java index 3fd0d483ef..59a0c9c649 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/GetSiteGroupTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/GetSiteGroupTests.java @@ -102,19 +102,6 @@ public class GetSiteGroupTests extends RestTest .assertLastError().containsSummary(String.format("An authority was not found for %s", getId(inexistentGroup))); } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) - @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION, - description = "Verify Manager role can get site group for empty siteId") - public void getSiteGroupForEmptySiteId() throws Exception - { - SiteModel emptySite = new SiteModel(""); - - restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)); - restClient.withCoreAPI().usingSite(emptySite).getSiteGroup(getId(consumer)); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, "")); - } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION, description = "Verify Manager role gets site groups with Manager role and status code is OK (200)") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/UpdateSiteGroupTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/UpdateSiteGroupTests.java index e143b732d9..02ec0cc0e7 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/UpdateSiteGroupTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/groups/UpdateSiteGroupTests.java @@ -146,16 +146,6 @@ public class UpdateSiteGroupTests extends RestTest restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format("An authority was not found for %s", getId(nonexistentUser))); } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) - @TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION, - description= "Verify if update site member request returns status code 404 when empty siteId is used") - public void updateSiteMemberUsingEmptySiteId() throws Exception - { - restClient.authenticateUser(adminUser).withCoreAPI().usingSite("").updateSiteGroup(getId(regularGroup), UserRole.SiteConsumer); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "")); - } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) @TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION, description= "Verify if update site member request returns status code 405 when empty personId is used") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/AddSiteMemberTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/AddSiteMemberTests.java index 4c097c9916..f5114e16a1 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/AddSiteMemberTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/AddSiteMemberTests.java @@ -312,18 +312,6 @@ public class AddSiteMemberTests extends RestTest restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, inexistentSite.getId())); } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) - @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION, - description = "Verify that user can not be added to a site if an empty site id is provided and gets status code 404") - public void userIsNotAbleToAddAnotherUserUsingEmptySiteId() throws Exception - { - UserModel testUser = dataUser.createRandomTestUser("testUser"); - testUser.setUserRole(UserRole.SiteManager); - SiteModel inexistentSite = new SiteModel(""); - restClient.authenticateUser(adminUserModel).withCoreAPI().usingSite(inexistentSite).addPerson(testUser); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, inexistentSite.getId())); - } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION, description = "Verify that inexistent user can not be added to site and gets status code 404") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/GetSiteMemberTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/GetSiteMemberTests.java index 41ca764b0b..8727300051 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/GetSiteMemberTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/GetSiteMemberTests.java @@ -172,19 +172,6 @@ public class GetSiteMemberTests extends RestTest restClient.assertStatusCodeIs(HttpStatus.OK); } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) - @TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION, - description = "Verify user with Manager role can get site member for empty siteId") - public void getSiteMemberForEmptySiteId() throws Exception - { - SiteModel emptySite = new SiteModel(""); - - restClient.authenticateUser(usersWithRoles.getOneUserWithRole(UserRole.SiteManager)); - restClient.withCoreAPI().usingSite(emptySite).getSiteMember(consumer); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsSummary(String.format(RestErrorModel.RELATIONSHIP_NOT_FOUND, consumer.getUsername(), emptySite.getId())); - } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) @TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.REGRESSION, description = "Verify user with Manager role gets site member with Manager role and status code is OK (200)") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/UpdateSiteMemberTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/UpdateSiteMemberTests.java index cb2fb09e8e..bc5373ef33 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/UpdateSiteMemberTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/sites/members/UpdateSiteMemberTests.java @@ -190,17 +190,6 @@ public class UpdateSiteMemberTests extends RestTest .and().field("role").is(meUser.getUserRole()); } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) - @TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION, - description= "Verify if update site member request returns status code 404 when empty siteId is used") - public void updateSiteMemberUsingEmptySiteId() throws Exception - { - restClient.authenticateUser(adminUser).withCoreAPI() - .usingSite("").updateSiteMember(regularUser); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "")); - } - @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION }) @TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.REGRESSION, description= "Verify if update site member request returns status code 405 when empty personId is used") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/AddProcessItemFullTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/AddProcessItemFullTests.java index 5db98f2c42..c0ff7430ff 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/AddProcessItemFullTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/AddProcessItemFullTests.java @@ -36,34 +36,6 @@ public class AddProcessItemFullTests extends RestTest document2 = dataContent.usingUser(adminUser).usingSite(siteModel).createContent(DocumentType.MSPOWERPOINT); dataWorkflow.usingUser(userWhoStartsProcess).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(assignee); } - - @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, - description = "Adding multiple process items is falling in case of empty process id is provided") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) - public void failedAddingMultipleProcessItemsIfEmptyProcessIdIsProvided() throws Exception - { - processModel = restClient.authenticateUser(adminUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel(); - FileModel testDocument = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); - - processModel.setId(""); - processItems = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItems(testDocument, document); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError() - .containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, "")); - } - - @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, - description = "Adding process items is falling in case of empty process id is provided") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) - public void failedAddingProcessItemsIfEmptyProcessIdIsProvided() throws Exception - { - processModel = restClient.authenticateUser(adminUser).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel(); - FileModel testDocument = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); - - processModel.setId(""); - processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(testDocument); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError() - .containsSummary(String.format(RestErrorModel.ENTITY_WAS_NOT_FOUND, "")); - } @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, description = "Adding process item is falling in case of empty body item value is provided") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/DeleteProcessItemFullTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/DeleteProcessItemFullTests.java index 13feac4565..eb4c8463f4 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/DeleteProcessItemFullTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/items/DeleteProcessItemFullTests.java @@ -36,27 +36,6 @@ public class DeleteProcessItemFullTests extends RestTest siteModel = dataSite.usingUser(userWhoStartsProcess).createPublicRandomSite(); document = dataContent.usingUser(userWhoStartsProcess).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); } - - @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, - description = "Try to delete existing process item using empty processId") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) - public void deleteProcessItemUsingEmptyProcessId() throws Exception - { - processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI() - .addProcess("activitiAdhoc", assignee, false, Priority.Normal); - document2 = dataContent.usingAdmin().usingSite(siteModel).createContent(DocumentType.MSPOWERPOINT); - processItem = restClient.withWorkflowAPI().usingProcess(processModel).addProcessItem(document2); - restClient.assertStatusCodeIs(HttpStatus.CREATED); - - processModel.setId(""); - restClient.withWorkflowAPI().usingProcess(processModel).deleteProcessItem(processItem); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError() - .containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "The entity with id: ")) - .descriptionURLIs(RestErrorModel.RESTAPIEXPLORER) - .containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY) - .stackTraceIs(RestErrorModel.STACKTRACE); - } @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, description = "Add a new process item, update the item and then delete.") diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariableFullTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariableFullTests.java index acda02df2c..d357467eab 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariableFullTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariableFullTests.java @@ -51,21 +51,6 @@ public class AddProcessVariableFullTests extends RestTest .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidProcessID")); } - @TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, - description = "Verify addProcessVariable by any user for empty processID with REST API and status code is NOT_FOUND (404)") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) - public void addProcessVariableWithEmptyProcessId() throws Exception - { - variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text"); - processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel(); - processModel.setId(""); - - processVariable = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI().usingProcess(processModel) - .updateProcessVariable(variableModel); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "")); - } - @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, description = "Adding process variable in case of having only 'name' field is provided") @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariablesCoreTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariablesCoreTests.java index 8b81bf7598..b4cc076072 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariablesCoreTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/AddProcessVariablesCoreTests.java @@ -49,21 +49,6 @@ public class AddProcessVariablesCoreTests extends RestTest .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidProcessID")); } - @TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, - description = "Verify addProcessVariable by any user for empty processID with REST API and status code is NOT_FOUND (404)") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) - public void addProcessVariableForEmptyProcessIdIsEmpty() throws Exception - { - variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text"); - processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel(); - processModel.setId(""); - - processVariable = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI().usingProcess(processModel) - .addProcessVariable(variableModel); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "")); - } - @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, description = "Adding multiple process variables is falling in case invalid process id is provided") @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) @@ -81,21 +66,4 @@ public class AddProcessVariablesCoreTests extends RestTest .assertLastError() .containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidProcessID")); } - - @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, - description = "Adding multiple process variables is falling in case empty process id is provided") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) - public void addMultipleProcessVariablesEmptyProcessId() throws Exception - { - variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:int"); - variableModel1 = RestProcessVariableModel.getRandomProcessVariableModel("d:text"); - processModel = restClient.authenticateUser(userWhoStartsProcess).withWorkflowAPI().getProcesses().getOneRandomEntry().onModel(); - processModel.setId(""); - - restClient.authenticateUser(assignee).withWorkflowAPI().usingProcess(processModel) - .addProcessVariables(variableModel1, variableModel); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError() - .containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "")); - } } diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/DeleteProcessVariableCoreTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/DeleteProcessVariableCoreTests.java index 68cbe1faaa..c7b2a6821b 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/DeleteProcessVariableCoreTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/processes/variables/DeleteProcessVariableCoreTests.java @@ -2,7 +2,6 @@ package org.alfresco.rest.workflow.processes.variables; import org.alfresco.dataprep.CMISUtil.DocumentType; import org.alfresco.rest.RestTest; -import org.alfresco.rest.exception.JsonToModelConversionException; import org.alfresco.rest.model.RestErrorModel; import org.alfresco.rest.model.RestProcessModel; import org.alfresco.rest.model.RestProcessVariableModel; @@ -76,27 +75,6 @@ public class DeleteProcessVariableCoreTests extends RestTest .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, variableModel.getName())); } - @TestRail(section = {TestGroup.REST_API,TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, - description = "Remove process variables with empty processId") - @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) - public void deleteProcessVariableEmptyProcessId() throws JsonToModelConversionException, Exception - { - variableModel = RestProcessVariableModel.getRandomProcessVariableModel("d:text"); - restProcessModel = restClient.authenticateUser(userWhoStartsTask).withWorkflowAPI() - .getProcesses().getProcessModelByProcessDefId(processModel.getId()); - restClient.withWorkflowAPI().usingProcess(restProcessModel).addProcessVariable(variableModel); - restClient.assertStatusCodeIs(HttpStatus.CREATED); - - restProcessModel.setId(""); - restClient.withWorkflowAPI().usingProcess(restProcessModel).deleteProcessVariable(variableModel); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError() - .containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "")) - .containsErrorKey(RestErrorModel.ENTITY_NOT_FOUND_ERRORKEY) - .descriptionURLIs(RestErrorModel.RESTAPIEXPLORER) - .stackTraceIs(RestErrorModel.STACKTRACE); - } - @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION, description = "Delete process variable with admin.") @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) diff --git a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/tasks/items/RemoveTaskItemTests.java b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/tasks/items/RemoveTaskItemTests.java index b452c82478..0821fad8d8 100644 --- a/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/tasks/items/RemoveTaskItemTests.java +++ b/packaging/tests/tas-restapi/src/test/java/org/alfresco/rest/workflow/tasks/items/RemoveTaskItemTests.java @@ -80,21 +80,6 @@ public class RemoveTaskItemTests extends RestTest .assertLastError().containsSummary(String.format(RestErrorModel.PROCESS_ENTITY_NOT_FOUND, "incorrectItemId")); } - @TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, - description = "Delete existing task item with empty task id") - @Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION }) - public void deleteTaskItemEmptyTaskId() throws Exception - { - taskModel = dataWorkflow.usingUser(userWhoStartsTask).usingSite(siteModel).usingResource(fileModel).createNewTaskAndAssignTo(assigneeUser); - restClient.authenticateUser(userWhoStartsTask); - document2 = dataContent.usingSite(siteModel).createContent(DocumentType.XML); - taskItem = restClient.withWorkflowAPI().usingTask(taskModel).addTaskItem(document2); - taskModel.setId(""); - restClient.withWorkflowAPI().usingTask(taskModel).deleteTaskItem(taskItem); - restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND) - .assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "")); - } - @TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION, description = "Delete existing task item with empty item id") @Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION }) @@ -252,4 +237,4 @@ public class RemoveTaskItemTests extends RestTest .descriptionURLIs(RestErrorModel.RESTAPIEXPLORER) .stackTraceIs(RestErrorModel.STACKTRACE); } -} \ No newline at end of file +}