mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4293: created capabilities for deleting transfer container and hold
container and restricted the deletion from behaviour beans
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user