mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge remote-tracking branch 'origin/master' into feature/RM-4023_UnfiledRecordFolderAPITests
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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>
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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>
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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")
|
||||
|
@@ -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")
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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")
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user