Merge branch 'master' of https://gitlab.alfresco.com/records-management/records-management into RM-4367_RecordCategoryAcceptOnly

This commit is contained in:
Rodica Sutu
2016-11-17 11:30:14 +02:00
37 changed files with 487 additions and 212 deletions

View File

@@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* POJO for file plan component
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public class FilePlanComponent
{

View File

@@ -17,7 +17,7 @@ import static org.alfresco.rest.rm.util.ParameterCheck.mandatoryString;
* File plan component alias enumeration
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public enum FilePlanComponentAlias
{

View File

@@ -21,7 +21,7 @@ import org.alfresco.rest.core.RestModels;
* POJO for file plan component entry
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public class FilePlanComponentEntry extends RestModels<FilePlanComponent, FilePlanComponentEntry>
{

View File

@@ -15,7 +15,7 @@ package org.alfresco.rest.rm.model.fileplancomponents;
* File plan component field names constants
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public class FilePlanComponentFields
{

View File

@@ -15,7 +15,7 @@ package org.alfresco.rest.rm.model.fileplancomponents;
* POJO for id/name pair
*
* @author Kristijan Conkas
* @since 1.0
* @since 2.6
*/
public class FilePlanComponentIdNamePair
{

View File

@@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
* POJO for FilePlanComponent path parameter
* <br>
* @author Kristijan Conkas
* @since 1.0
* @since 2.6
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class FilePlanComponentPath

View File

@@ -28,7 +28,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* POJO for file plan component properties
*
* @author Kristijan Conkas
* @since 1.0
* @since 2.6
*/
//FIXME: Once the fields have been added the JsonIgnoreProperties annotation should be removed
@JsonIgnoreProperties (ignoreUnknown = true)

View File

@@ -17,7 +17,7 @@ import static org.alfresco.rest.rm.util.ParameterCheck.mandatoryString;
* File plan component type enumeration
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public enum FilePlanComponentType
{

View File

@@ -15,7 +15,7 @@ package org.alfresco.rest.rm.model.fileplancomponents;
* POJO for file plan component created by object
*
* @author Kristijan Conkas
* @since 1.0
* @since 2.6
*/
public class FilePlanComponentUserInfo
{

View File

@@ -17,7 +17,7 @@ import org.alfresco.rest.core.RestModels;
* Handle collection of FilePlanComponents
*
* @author Kristijan Conkas
* @since 1.0
* @since 2.6
*/
public class FilePlanComponentsCollection extends RestModels<FilePlanComponentEntry, FilePlanComponentsCollection>
{

View File

@@ -4,7 +4,7 @@ package org.alfresco.rest.rm.model.fileplancomponents;
* POJO for the review period
*
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
public class ReviewPeriod
{

View File

@@ -19,7 +19,7 @@ import org.alfresco.rest.model.RestSiteModel;
* POJO for RM Site component
*
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
public class RMSite extends RestSiteModel
{

View File

@@ -15,7 +15,7 @@ package org.alfresco.rest.rm.model.site;
* RM Site compliance
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public enum RMSiteCompliance
{

View File

@@ -24,7 +24,7 @@ package org.alfresco.rest.rm.model.site;
*}
* @author Tuna Aksoy
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
public class RMSiteFields
{

View File

@@ -33,7 +33,7 @@ import org.springframework.stereotype.Component;
*
* @author Tuna Aksoy
* @author Kristijan Conkas
* @since 1.0
* @since 2.6
*/
@Component
@Scope(value = "prototype")

View File

@@ -31,7 +31,7 @@ import org.springframework.stereotype.Component;
*
* @author Tuna Aksoy
* @author Rodica Sutu
* @since 1.0
* @since 2.6
*/
@Component
@Scope (value = "prototype")

View File

@@ -17,7 +17,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
* Utility class for checking parameters
*
* @author Tuna Aksoy
* @since 1.0
* @since 2.6
*/
public class ParameterCheck
{

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

@@ -50,7 +50,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

@@ -32,7 +32,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

@@ -54,7 +54,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
{