ACS-4005 Remove tests for empty path parameters. [tas][ags]

This commit is contained in:
Tom Page
2022-11-16 09:20:32 +00:00
parent 19b5af2eee
commit cc23d94054
13 changed files with 9 additions and 223 deletions

View File

@@ -1,5 +1,7 @@
package org.alfresco.rest.favorites; package org.alfresco.rest.favorites;
import java.util.UUID;
import org.alfresco.dataprep.CMISUtil; import org.alfresco.dataprep.CMISUtil;
import org.alfresco.dataprep.SiteService; import org.alfresco.dataprep.SiteService;
import org.alfresco.rest.RestTest; import org.alfresco.rest.RestTest;
@@ -189,13 +191,13 @@ public class GetFavoriteSiteTests extends RestTest
sites.assertThat().entriesListIsNotEmpty(); sites.assertThat().entriesListIsNotEmpty();
} }
@Test(groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION }) @Test (groups = { TestGroup.REST_API, TestGroup.PEOPLE, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION, @TestRail (section = { TestGroup.REST_API, TestGroup.PEOPLE }, executionType = ExecutionType.REGRESSION,
description = "Verify invalid request returns status 401 when user is empty") description = "Verify invalid request returns status 401 when user does not exist")
public void getFavoriteSiteWithEmptyPersonId() throws Exception public void getFavoriteSiteWithFictionalPersonId()
{ {
UserModel emptyUser = new UserModel("", "password"); UserModel fictionalUser = new UserModel("FictionalUser" + UUID.randomUUID(), "password");
restClient.authenticateUser(emptyUser).withCoreAPI().usingAuthUser().getFavoriteSite(siteModel1); restClient.authenticateUser(fictionalUser).withCoreAPI().usingAuthUser().getFavoriteSite(siteModel1);
restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED); restClient.assertStatusCodeIs(HttpStatus.UNAUTHORIZED);
} }

View File

@@ -211,30 +211,6 @@ public class GetSiteContainerTests extends RestTest
.stackTraceIs(RestErrorModel.STACKTRACE); .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 }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.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") description= "Verify if get container with name containing special chars returns status code 404")

View File

@@ -102,19 +102,6 @@ public class GetSiteGroupTests extends RestTest
.assertLastError().containsSummary(String.format("An authority was not found for %s", getId(inexistentGroup))); .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 }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.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)") description = "Verify Manager role gets site groups with Manager role and status code is OK (200)")

View File

@@ -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))); 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 }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.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") description= "Verify if update site member request returns status code 405 when empty personId is used")

View File

@@ -312,18 +312,6 @@ public class AddSiteMemberTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.NOT_FOUND).assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, inexistentSite.getId())); 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 }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = {TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.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") description = "Verify that inexistent user can not be added to site and gets status code 404")

View File

@@ -172,19 +172,6 @@ public class GetSiteMemberTests extends RestTest
restClient.assertStatusCodeIs(HttpStatus.OK); 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 }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section = { TestGroup.REST_API, TestGroup.SITES }, executionType = ExecutionType.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)") description = "Verify user with Manager role gets site member with Manager role and status code is OK (200)")

View File

@@ -190,17 +190,6 @@ public class UpdateSiteMemberTests extends RestTest
.and().field("role").is(meUser.getUserRole()); .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 }) @Test(groups = { TestGroup.REST_API, TestGroup.SITES, TestGroup.REGRESSION })
@TestRail(section={TestGroup.REST_API, TestGroup.SITES}, executionType= ExecutionType.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") description= "Verify if update site member request returns status code 405 when empty personId is used")

View File

@@ -36,34 +36,6 @@ public class AddProcessItemFullTests extends RestTest
document2 = dataContent.usingUser(adminUser).usingSite(siteModel).createContent(DocumentType.MSPOWERPOINT); document2 = dataContent.usingUser(adminUser).usingSite(siteModel).createContent(DocumentType.MSPOWERPOINT);
dataWorkflow.usingUser(userWhoStartsProcess).usingSite(siteModel).usingResource(document).createNewTaskAndAssignTo(assignee); 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, @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") description = "Adding process item is falling in case of empty body item value is provided")

View File

@@ -36,27 +36,6 @@ public class DeleteProcessItemFullTests extends RestTest
siteModel = dataSite.usingUser(userWhoStartsProcess).createPublicRandomSite(); siteModel = dataSite.usingUser(userWhoStartsProcess).createPublicRandomSite();
document = dataContent.usingUser(userWhoStartsProcess).usingSite(siteModel).createContent(DocumentType.TEXT_PLAIN); 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, @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW,TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
description = "Add a new process item, update the item and then delete.") description = "Add a new process item, update the item and then delete.")

View File

@@ -51,21 +51,6 @@ public class AddProcessVariableFullTests extends RestTest
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidProcessID")); .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, @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") description = "Adding process variable in case of having only 'name' field is provided")
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })

View File

@@ -49,21 +49,6 @@ public class AddProcessVariablesCoreTests extends RestTest
.assertLastError().containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidProcessID")); .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, @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") 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 }) @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })
@@ -81,21 +66,4 @@ public class AddProcessVariablesCoreTests extends RestTest
.assertLastError() .assertLastError()
.containsSummary(String.format(RestErrorModel.ENTITY_NOT_FOUND, "invalidProcessID")); .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, ""));
}
} }

View File

@@ -2,7 +2,6 @@ package org.alfresco.rest.workflow.processes.variables;
import org.alfresco.dataprep.CMISUtil.DocumentType; import org.alfresco.dataprep.CMISUtil.DocumentType;
import org.alfresco.rest.RestTest; import org.alfresco.rest.RestTest;
import org.alfresco.rest.exception.JsonToModelConversionException;
import org.alfresco.rest.model.RestErrorModel; import org.alfresco.rest.model.RestErrorModel;
import org.alfresco.rest.model.RestProcessModel; import org.alfresco.rest.model.RestProcessModel;
import org.alfresco.rest.model.RestProcessVariableModel; 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())); .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, @TestRail(section = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES }, executionType = ExecutionType.REGRESSION,
description = "Delete process variable with admin.") description = "Delete process variable with admin.")
@Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION }) @Test(groups = { TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.PROCESSES, TestGroup.REGRESSION })

View File

@@ -80,21 +80,6 @@ public class RemoveTaskItemTests extends RestTest
.assertLastError().containsSummary(String.format(RestErrorModel.PROCESS_ENTITY_NOT_FOUND, "incorrectItemId")); .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, @TestRail(section = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS }, executionType = ExecutionType.REGRESSION,
description = "Delete existing task item with empty item id") description = "Delete existing task item with empty item id")
@Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION }) @Test(groups = {TestGroup.REST_API, TestGroup.WORKFLOW, TestGroup.TASKS, TestGroup.REGRESSION })
@@ -252,4 +237,4 @@ public class RemoveTaskItemTests extends RestTest
.descriptionURLIs(RestErrorModel.RESTAPIEXPLORER) .descriptionURLIs(RestErrorModel.RESTAPIEXPLORER)
.stackTraceIs(RestErrorModel.STACKTRACE); .stackTraceIs(RestErrorModel.STACKTRACE);
} }
} }