RM-4293: created capabilities for deleting transfer container and hold

container and restricted the deletion from behaviour beans
This commit is contained in:
Silviu Dinuta
2016-11-16 15:09:58 +02:00
parent 7d884e857c
commit bee71d2dbd
7 changed files with 128 additions and 3 deletions

View File

@@ -198,7 +198,7 @@ public class FilePlanTests extends BaseRestTest
/**
* Given that a file plan exists
* When I ask the API to delete the file plan
* Then the 403 response code is returned.
* Then the 422 response code is returned.
*/
@Test
(
@@ -217,6 +217,40 @@ public class FilePlanTests extends BaseRestTest
// Delete the file plan component
filePlanComponentAPI.deleteFilePlanComponent(filePlanAlias.toString());
// Check the DELETE response status code
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
}
/**
* Given that a file plan exists and I am a non RM user
* When I ask the API to delete the file plan
* Then the 403 response code is returned.
*/
@Test
(
description = "Check the response code when deleting the special file plan components with non RM user",
dataProviderClass = TestData.class,
dataProvider = "getContainers"
)
public void deleteFilePlanSpecialComponentsNonRMUser(String filePlanAlias) throws Exception
{
// Create RM Site if doesn't exist
createRMSiteIfNotExists();
// Disconnect the current user from the API session
rmSiteAPI.usingRestWrapper().disconnect();
// Authenticate admin user to Alfresco REST API
restClient.authenticateUser(dataUser.getAdminUser());
// Create a random user
UserModel nonRMuser = dataUser.createRandomTestUser("testUser");
// Authenticate using the random user
filePlanComponentAPI.usingRestWrapper().authenticateUser(nonRMuser);
// Delete the file plan component
filePlanComponentAPI.deleteFilePlanComponent(filePlanAlias.toString());
// Check the DELETE response status code
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(FORBIDDEN);
}