Merge remote-tracking branch 'origin/master' into feature/RM-4023_UnfiledRecordFolderAPITests

This commit is contained in:
Kristijan Conkas
2016-11-17 09:29:57 +00:00
37 changed files with 487 additions and 212 deletions

View File

@@ -15,7 +15,7 @@ package org.alfresco.rest.rm.base;
* List of allowable operations
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public class AllowableOperations
{

View File

@@ -51,7 +51,7 @@ import org.testng.annotations.BeforeClass;
*
* @author Kristijan Conkas
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
@Configuration
@PropertySource("classpath:default.properties")

View File

@@ -27,7 +27,7 @@ import org.testng.annotations.DataProvider;
* Test data used in tests
*
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
public interface TestData
{

View File

@@ -52,7 +52,7 @@ import org.testng.annotations.Test;
* the File Plan CRUD API
*
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
public class FilePlanTests extends BaseRestTest
{
@@ -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);
}

View File

@@ -51,7 +51,7 @@ import org.testng.annotations.Test;
*
* @author Kristijan Conkas
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public class RecordCategoryTest extends BaseRestTest
{

View File

@@ -61,7 +61,7 @@ import org.testng.annotations.Test;
* the Record Folder CRUD API
*
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
public class RecordFolderTests extends BaseRestTest
{

View File

@@ -51,7 +51,7 @@ import org.testng.annotations.Test;
* the RM site CRUD API
*
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
public class RMSiteTests extends BaseRestTest
{