fix the test createFilePlanSpecialContainerWhenExists()

This commit is contained in:
Rodica Sutu
2016-11-02 10:37:15 +02:00
parent 43e483d0bc
commit 026e956df3

View File

@@ -234,22 +234,24 @@ public class FilePlanTests extends BaseRestTest
@Bug(id="RM-4296") @Bug(id="RM-4296")
public void createFilePlanSpecialContainerWhenExists(FilePlanComponentAlias filePlanAlias, FilePlanComponentType rmType) throws Exception public void createFilePlanSpecialContainerWhenExists(FilePlanComponentAlias filePlanAlias, FilePlanComponentType rmType) throws Exception
{ {
String rmSiteId = rmSiteAPI.getSite().getGuid();
// Create RM Site if doesn't exist // Create RM Site if doesn't exist
createRMSiteIfNotExists(); createRMSiteIfNotExists();
// Authenticate with admin user // Authenticate with admin user
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser()); rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
// Get the RM site ID
String rmSiteId = rmSiteAPI.getSite().getGuid();
String name = filePlanAlias + getRandomAlphanumeric(); String name = filePlanAlias + getRandomAlphanumeric();
//Build the file plan root properties // Build the file plan root properties
JsonObject componentProperties = buildObject() JsonObject componentProperties = buildObject()
.add(NAME, name) .add(NAME, name)
.add(NODE_TYPE, rmType.toString()) .add(NODE_TYPE, rmType.toString())
.getJson(); .getJson();
// Authenticate with admin user
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
// Create the special containers into RM site - parent folder // Create the special containers into RM site - parent folder
filePlanComponentAPI.createFilePlanComponent(componentProperties, rmSiteId); filePlanComponentAPI.createFilePlanComponent(componentProperties, rmSiteId);
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(FORBIDDEN); filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(FORBIDDEN);